From f387e10632c91f0b6b258fb9bf991042e755f8c2 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 30 Jul 2026 16:32:34 -0700 Subject: [PATCH 1/6] Squashed '.claude/skills/seclai-changelog/' changes from 177d423..3558844 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3558844 Add the surface check; report API version changes; record the changelog rule 9ac3bdb Add provenance banner to the vendored skills 4abc72a Tweak Go handling 22d0637 Updated version link instructions for Go ae892f0 Updated skill to clarify type handling fad3662 Added shared skill to update SDK change logs REVERT: 177d423 Internal review fixes REVERT: a2aa7ef Add the surface check; report API version changes; record the changelog rule REVERT: e89d300 Note that a typed façade is invisible to the returns check REVERT: 4f4113d Note that dated versioning gives one operation two legal response shapes REVERT: 5ab0384 Add returns and models audits; fix spec-diff and extractor defects REVERT: 07d1323 Fixed gaps REVERT: b6e5468 Addressed review comments REVERT: 6189884 Tweaks REVERT: ea07ba9 Add provenance banner to the vendored skills REVERT: 58ff6ce Do not check in python cache files REVERT: 9b18406 Added scripts and skill to help update SDKs git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: 3558844f2aa6473f218213966e66f10e0ff20f45 --- .claude/settings.json | 8 - .claude/skills/seclai-sdk-sync/SKILL.md | 305 - .claude/skills/seclai-sdk-sync/docexamples.py | 230 - .claude/skills/seclai-sdk-sync/sdksync.py | 1278 - .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-changelog/SKILL.md => SKILL.md | 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/__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 - .../validate.py => validate.py | 0 709 files changed, 137665 deletions(-) delete mode 100644 .claude/settings.json delete mode 100644 .claude/skills/seclai-sdk-sync/SKILL.md delete mode 100755 .claude/skills/seclai-sdk-sync/docexamples.py delete mode 100755 .claude/skills/seclai-sdk-sync/sdksync.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-changelog/SKILL.md => SKILL.md (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 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 rename .claude/skills/seclai-changelog/validate.py => validate.py (100%) 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-sdk-sync/SKILL.md b/.claude/skills/seclai-sdk-sync/SKILL.md deleted file mode 100644 index bfdad17..0000000 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ /dev/null @@ -1,305 +0,0 @@ ---- -name: seclai-sdk-sync -description: Sync a Seclai SDK (seclai-python, seclai-javascript, seclai-go, seclai-csharp, seclai-cli, seclai-mcp) to a new OpenAPI spec, or add endpoints to one. Use when a new openapi/seclai.openapi.json has been copied in, when asked to add missing endpoints or check endpoint coverage, or when auditing an SDK against the API spec. ---- - -# Syncing a Seclai SDK to a new spec - -> **Vendored file — do not edit in place.** The canonical copy lives in the -> `seclai/sdk-tools` repository at `skills/seclai-sdk-sync/`, 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. - -Run the analysis with `sdksync.py`, bundled next to this file, rather than -hand-rolling greps. Every ad-hoc parity regex written so far has missed methods -with multi-line signatures. - -```bash -S=.claude/skills/seclai-sdk-sync/sdksync.py # vendored into each SDK repo - -python3 $S spec-diff HEAD # what the new spec changed -python3 $S parity . # spec paths with no request call -python3 $S params . # params the endpoint does not accept -python3 $S returns . # return types that disagree with the spec -python3 $S models . --since HEAD # hand-written models left behind -python3 $S surface 1.3.0 # is this release breaking? -python3 $S api-delta 1.3.0 # public methods added since a tag -``` - -The three audits are three different directions, and each finds what the others -structurally cannot: - -| | direction | catches | -| --- | --- | --- | -| `parity` | spec → client | endpoints nobody implemented | -| `params` | client → spec | query keys the endpoint ignores or requires | -| `returns` | client → spec | a response shape the client can no longer deserialize | - -`parity`, `params`, `returns`, `models` and `surface` exit non-zero on a finding, so all work as CI gates. -Run the **canonical** copy from `sdk-tools`, or `./sync.sh --check` first. The -vendored copies go stale whenever a repo has uncommitted work, since `sync.sh` -skips dirty repos — a stale `spec-diff` reported 123 changed paths as -"description/params only" and hid 26 response changes. - -Run them over the **whole spec**, never just the diff — `GET /me` sat unimplemented -in both the Python and JavaScript SDKs for months because each sync only looked at -its own new paths. - -## `params` — the check that catches what tests cannot - -`parity` walks spec→client. `params` walks client→spec, and that direction finds a -different and more dangerous class of defect, because the API silently ignores -query params it does not declare: - -- **UNDECLARED** — the client sends a key the endpoint does not accept. The filter - simply does nothing and the caller gets unfiltered results. -- **NOT IN SPEC** — the client calls a path the spec does not declare. `parity` - cannot see this by construction. -- **UNPARSED** — a query-construction site the extractor could not read. Treated as - an error, never as clean: a parser that gives up quietly is the failure this tool - exists to prevent. -- **UNEXPOSED** (warning) — a declared param no method sends; a coverage gap. - -Tests do not defend against this class. The SDK tests were written from the same -table as the code, so they assert the same wrong parameter names — one Go test -asserted the buggy `query` instead of the required `q`, locking the defect in. The -spec is the only independent oracle. - -**Treat a finding you believe is wrong as a bug in the tool, not as noise to skip.** -Twice now that instinct was right: Go's `GetMe` was reported as sending -page/limit/sort/order it never sends (a method block ran on past its own function -and swallowed the helpers below it), and `Search` was reported as never sending its -required `q` (the extractor read `q["k"] =` but not the map literal that sets it). -Four of six Go findings were artefacts. Since both were fixed, all four SDKs report -the *same* three findings — independently-written clients agreeing is the signal -that the check is reading them correctly. - -## `returns` — the axis that catches a changed response - -Compares each method's **declared return type** against the spec's response -schema, and splits the result by how much it costs you: - -- **SHAPE MISMATCH** (error) — the client commits to a list and the endpoint - returns an object, or the reverse. This throws at deserialization; a shipped - SDK is already broken. This is the 2026-07 envelope change. -- **NAME DIFFERS** (warning) — same shape, different type name. All four SDKs - drop the spec's `Model` and `Api` affixes by convention, so this tier is mostly - noise by design. Keep it out of CI with `--quiet-renamed`. -- **UNTYPED** (warning) — the spec names a schema and the client returns - `JsonElement` / `json.RawMessage` / `unknown` / `JSONValue`. Not a defect, but - it is the coverage backlog: seclai-python reports 206. - -**A typed façade is invisible to this check.** seclai-csharp and seclai-go keep -their raw `JsonElement` / `json.RawMessage` methods and put the typed forms on -`client.Typed` / `client.Typed()`, so a raw-return signature is deliberate, not a -gap. Those façade methods delegate rather than issuing their own request, so -`block_call` finds no verb in them and they are never matched — the UNTYPED count -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. - -**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 — -and the spec documents only the default. A client that decodes both and declares -the envelope is therefore reported as a SHAPE MISMATCH and is *correct*. Two Go -methods sit in that state deliberately. Verify against the header before -"fixing" one; do not retype a permissive client to satisfy this check. - -A wholly untyped return is never a shape error — it commits to nothing and -deserializes anything. But `list[dict[str, Any]]` **is** a commitment to a list, -and is graded as one. - -## `surface` — is this release breaking? - -Diffs the public API surface against the last released tag. Neither the changelog -nor the compiler can answer this: in 2026-07 a C# method gained an optional -parameter, every call site still compiled, the build was green — and it was -**binary breaking**, because adding a parameter changes the method's metadata -token and a consumer that does not recompile fails at runtime. - -Run it before writing the changelog and before tagging: - -```bash -python3 $S surface 1.3.0 # csharp/python: bare tag. go: v-prefixed -``` - -Findings are graded by what actually breaks a caller, because a raw signature -diff called 21 JavaScript changes breaking when none were: - -- **REMOVED / BREAKING** (error) — a released signature no longer works: method - gone, parameter list changed, or a return type changed in a static language. -- **WARN** — compatible but worth checking: a *trailing* optional parameter - (source compatible; flagged as binary breaking for C#), `unknown` narrowed to a - concrete type in TypeScript (safe), or a Python return annotation (not enforced - — but confirm the runtime value did not change too). - -An optional parameter inserted *mid-list* is graded breaking, not a warning: in -C# a positional `M(id, token)` then tries to bind `token` to the new parameter. -Use an overload rather than growing a parameter list. - -## Verifying a bulk edit - -`as`/cast assertions are unchecked, so a green typecheck proves nothing about a -mass find-and-replace. A regex pass over `client.ts` in 2026-07 rewrote 129 -return sites — 20 intended — and broke the parens twice. - -Extract a per-method profile from the old and new sources and diff it, rather -than reading the patch: name, verb, path, query keys, request-call count. 162 of -167 methods came back byte-identical and the 5 differences were each an intended -edit, which is the assurance the diff itself cannot give. `surface` covers the -signature half of this; the request half is a few lines of `re.finditer` over -both revisions. - -## `models` — hand-written models that fell behind - -Only seclai-csharp: everywhere else regeneration keeps models in step. Use -`--since `, which limits the report to properties a schema **gained** since -that rev. Without it you get every long-standing coverage gap — 27 for -seclai-csharp, none of them actionable, which is how a gate gets muted. - -It cannot see models whose schema is declared inline rather than as a named -component; it prints how many are unchecked for that reason. Two of the six -models left stale in 2026-07 were in that blind spot, so treat the count as real. - -## `docexamples` — compile the README - -```bash -D=.claude/skills/seclai-sdk-sync/docexamples.py -python3 $D list . # every fence and whether it is checked -python3 $D check . # compile the marked ones -``` - -Opt-in: mark a fence by putting `` on the line directly above -it. Invisible on GitHub, npm and pkg.go.dev. Most fences are deliberate fragments — -3 of 39 TypeScript fences carry an import — so compiling everything would mean -rewriting the READMEs first. `list` prints the marked fraction so coverage can be -raised over time. TypeScript and Go only; Python examples are plain dicts with -nothing to typecheck. - -Mark any example you add or change. `npm run typecheck` and `go build` do **not** -cover README snippets, and two shipped PRs contained examples that could not compile. - -## The repos are not uniform - -| Repo | Client | Bundles spec | Notes | -| --- | --- | --- | --- | -| seclai-python | generated + hand-written wrappers | yes | `make generate`, then black | -| seclai-javascript | types generated, methods hand-written | yes | `npm run generate` | -| seclai-go | hand-written | yes | | -| seclai-csharp | hand-rolled from the start | **no** | no codegen library was suitable; still at near-full parity — sync it like the others | -| seclai-cli | wraps `@seclai/sdk` | no | coverage question is command-to-SDK-method | -| seclai-mcp | no client source | no | | - -For repos without a bundled spec, point at one: -`--spec ../seclai-python/openapi/seclai.openapi.json`. - -## Workflow - -1. **Confirm the spec is identical** across the repos that bundle it. They must - not diverge — a local edit is always wrong; fix the spec upstream in `seclai`. -2. **`spec-diff`** to see added/removed/changed paths and schema property changes. - - Under each changed path it names what a client can observe — `+query`, - `~query … is now required`, `~request`, `~response` — and only says - `(docs only)` when nothing but prose moved. A `~response` line is the one to - stop on: it means a **shipped** SDK is already failing to deserialize, because - the server changed under it. In the 2026-07 fast-follow two endpoints went from - a bare array to a paginated envelope, breaking the method in all four SDKs. - - Do not stop at the new paths. The `SCHEMA PROPERTY CHANGES` section lists - **existing** models that gained fields, and those are easy to miss because - nothing about them looks new. Repos with generated models pick them up on - regeneration; hand-written ones (seclai-csharp) do not. In the 2026-07 sync six - C# models were left stale this way, including the `disabled` fields that agent - pause/resume depends on — the methods shipped but the state they set was - invisible in the response. -3. **Regenerate**, per repo: - - python: `make generate`, then **immediately** `poetry run black .` — the - generator formats with ruff but the repo commits black, so raw output shows - ~240 changed files that collapse to ~60 real ones. - - javascript: `npm run generate` (no churn; types only). - - go / csharp: nothing to regenerate. -4. **`parity`** to list what is missing. Implement every path, not just the ones - that look interesting — binary/stream endpoints with no JSON schema are the - ones that get skipped. -5. **Write the methods.** In Python they must land in **both** `Seclai` and - `AsyncSeclai`. Generating both from a single table of method definitions is - the reliable way to keep them identical; hand-writing 2×N methods into an - 8,000-line file drifts, and no test asserts the two classes match. Working - emitters from the last sync are in `emit-examples/` in the `sdk-tools` repo — - copy and adapt one, they are reference material rather than a supported API. - - Generation removes transcription drift but propagates a wrong table uniformly - to every call site. Two defects in the last sync were faithful emissions of a - bad table. Audit the result with `params` before trusting it. -6. **Tests** — sync and async for each method, asserting verb, path, query params - and body. Python uses `httpx.MockTransport`; JavaScript uses a `makeClient` - fetch stub. -7. **README** — one section per new endpoint group. -8. **Version constants** — if `spec-diff` printed `API VERSIONS CHANGED`, update - each SDK's version constants. They are pinned per release and an unknown - version is rejected at construction, so a new API version is unusable until - they are updated. Each SDK has a test asserting the constants match - `x-seclai-versions`, so this fails loudly if skipped. -9. **`surface`** against the last released tag — confirm the release is additive, - or decide deliberately to bump the major. -10. **Changelog** — use the `seclai-changelog` skill. Write entries against the - last released tag, never against the branch's earlier state. -11. **Gate**: `make lint && make test` (python) or - `npm run typecheck && npm test && npm run build` (javascript). Re-run `parity` - and confirm zero missing. - -## Naming - -A new method name sets precedent for all six SDKs — the first repo synced defines -it and the rest should follow. Check whether a sibling already named the same -endpoint before inventing one, and prefer the sibling's name transliterated to -local conventions (`searchDocs` / `search_docs` / `SearchDocs`). - -## Typing conventions - -- Return the shape the spec declares: a `$ref` becomes the aliased type, never an - untyped map. See the `seclai-changelog` skill for the full table and the - breaking-change rules. -- **JavaScript:** openapi-typescript emits any property carrying a `default` as - **required**, even when the spec omits it from `required`. Wrap the generated - request so server-defaulted fields stay optional: - `Pick & Partial>` — see `AddEmailDomainInput`. -- Query params are camelCase in the method signature, snake_case on the wire. - -## Repo gotchas - -**seclai-python** - -- `poetry run black .` will reformat the **subtree-vendored** `.claude/skills/` - files and silently drift them from canonical. `.claude` must stay excluded in - black `extend-exclude`, ruff `exclude`, and mypy `exclude`. -- `make generate` always prints - `Unable to parse schema … duplicate models with name "FileUploadResponse"`. - Pre-existing and non-fatal — `routers__api__sources__` and - `routers__api__contents__FileUploadResponse` share a title. Generation completes. -- `seclai/_generated/seclai_api_client/` is **not** regenerated and nothing - imports it. It is stale and safe to ignore; do not treat it as a source of truth. -- mypy rejects assigning the result of a `-> None` method, so tests for - 204-returning endpoints must call without binding a variable. - -**seclai-csharp** - -- Adding a parameter — even an optional one — is **binary breaking** for a NuGet - consumer that does not recompile, and inserting one before a trailing - `CancellationToken` breaks positional callers at compile time too. Add an - overload instead. `surface` catches both. - -**seclai-javascript** - -- `npm run typecheck` does not cover README snippets. Paste any example into a - scratch `.ts` importing from `../src/index` and compile it before claiming it works. - -## Release - -The version comes from the merge commit message, read by `seclai/github-tag-action` -with `DEFAULT_BUMP: patch`. A sync that adds endpoints needs `#minor` in the PR -title, or it ships as a patch and the changelog heading will not match the tag. diff --git a/.claude/skills/seclai-sdk-sync/docexamples.py b/.claude/skills/seclai-sdk-sync/docexamples.py deleted file mode 100755 index 3ec8b2b..0000000 --- a/.claude/skills/seclai-sdk-sync/docexamples.py +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python3 -"""Compile the README examples of a Seclai SDK. Never executes them. - - docexamples.py list [repo] every fence, with its marker state - docexamples.py check [repo] compile the marked fences - -Opt-in by marker. Most fences are deliberate fragments — 3 of 39 TypeScript -fences and 2 of 34 Go fences carry an import — so compiling everything would -mean rewriting the READMEs first. Mark a fence by putting this immediately -above it; it is an HTML comment, so it stays invisible on GitHub, npm and -pkg.go.dev: - - - -`list` prints the marked fraction so coverage is a number that can be driven up -over time rather than a cliff to be turned off. - -Unlike sdksync.py this shells out to the repo's own toolchain, so it only runs -where that toolchain exists. It is deliberately a separate script: a doc check -that needs `tsc` must never be able to break the spec audit that does not. -""" -from __future__ import annotations - -import argparse -import re -import shutil -import subprocess -import sys -from pathlib import Path - -MARKER = "" -SCRATCH = ".doccheck" - -LANGS = { - "javascript": {"detect": "src/client.ts", "fence": "ts", "tool": "npx"}, - "go": {"detect": "client.go", "fence": "go", "tool": "go"}, -} - - -def die(msg: str) -> None: - print(f"error: {msg}", file=sys.stderr) - raise SystemExit(2) - - -def detect(repo: Path) -> str | None: - for name, cfg in LANGS.items(): - if (repo / cfg["detect"]).exists(): - return name - return None - - -def fences(readme: str, tag: str) -> list[tuple[int, bool, str]]: - """(1-indexed start line, marked, body) for every ``` fence.""" - out = [] - for m in re.finditer(rf"```{tag}\n(.*?)```", readme, re.S): - line = readme[:m.start()].count("\n") + 1 - before = readme[:m.start()].rstrip().rsplit("\n", 1)[-1].strip() - out.append((line, before == MARKER, m.group(1))) - return out - - -# ── per-language compilation ───────────────────────────────────────────────── -def check_javascript(repo: Path, marked: list[tuple[int, str]]) -> list[str]: - scratch = repo / SCRATCH - shutil.rmtree(scratch, ignore_errors=True) - scratch.mkdir() - # (README line of the fence, number of lines prepended before the body). - origin: list[tuple[int, int]] = [] - try: - for i, (line, body) in enumerate(marked): - parts = [] - if "import " not in body: - parts.append('import { Seclai } from "../src/index";') - if not re.search(r"\b(const|let|var)\s+client\b", body): - parts.append("declare const client: Seclai;") - # Wrapped so top-level `await` is legal in a fragment. - parts.append("export async function _example() {") - origin.append((line, len(parts))) - parts += [body, "}"] - (scratch / f"ex{i}.ts").write_text("\n".join(parts)) - - r = subprocess.run( - ["npx", "tsc", "--noEmit", "--strict", "--skipLibCheck", - "--target", "es2022", "--module", "esnext", - "--moduleResolution", "bundler", "--lib", "es2022,dom", - "--noUnusedLocals", "false", - *[str(p) for p in sorted(scratch.glob("*.ts"))]], - cwd=repo, capture_output=True, text=True) - if r.returncode == 0: - return [] - # Map "ex3.ts(12,5): error ..." back to a README line number. SCRATCH is - # escaped because it starts with a `.`, which as a regex metachar would - # match any character. The tsc line number is used rather than discarded: - # without it every error in a fence pointed at the fence header, so a - # 30-line example gave the reader one line number for all of them. - pat = re.compile(rf"^{re.escape(SCRATCH)}/ex(\d+)\.ts\((\d+),\d+\):\s*(.*)$") - out = [] - for ln in (r.stdout + r.stderr).splitlines(): - m = pat.match(ln) - if m: - readme_line, prefix = origin[int(m.group(1))] - # Body line 1 sits at generated line prefix+1 and at README line - # readme_line+1, so the two differ by exactly `prefix`. - out.append(f"README.md:{max(readme_line, readme_line + int(m.group(2)) - prefix)}" - f" — {m.group(3)}") - elif ln.strip(): - out.append(ln) - return out - finally: - shutil.rmtree(scratch, ignore_errors=True) - - -def check_go(repo: Path, marked: list[tuple[int, str]]) -> list[str]: - gomod = (repo / "go.mod").read_text() - module = re.search(r"^module\s+(\S+)", gomod, re.M) - if not module: - die("cannot read module path from go.mod") - scratch = repo / SCRATCH - shutil.rmtree(scratch, ignore_errors=True) - scratch.mkdir() - try: - (scratch / "go.mod").write_text( - f"module doccheck\n\ngo 1.22\n\n" - f"require {module.group(1)} v0.0.0\n\n" - f"replace {module.group(1)} => ..\n") - if (repo / "go.sum").exists(): - shutil.copy(repo / "go.sum", scratch / "go.sum") - - # Every example goes into one file, so remember where each body landed. - # `go build` reports `./main.go:42:3: ...` and the finally block deletes - # main.go, so an unmapped diagnostic points the reader at a file that no - # longer exists. (first generated line, last generated line, README line) - text = ("package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n" - f"\t\"{module.group(1)}\"\n)\n\n" - "var (\n\tctx = context.Background()\n\t_ = fmt.Sprint\n" - f"\tclient, _ = seclai.NewClient(seclai.Options{{APIKey: \"k\"}})\n)\n\n") - spans: list[tuple[int, int, int]] = [] - for i, (line, b) in enumerate(marked): - if i: - text += "\n\n" - text += f"func _example{i}() {{\n" - first = text.count("\n") + 1 - text += f"{b}\n" - spans.append((first, text.count("\n"), line)) - text += "}" - text += "\n\nfunc main() {}\n" - (scratch / "main.go").write_text(text) - - subprocess.run(["go", "mod", "tidy"], cwd=scratch, - capture_output=True, text=True) - r = subprocess.run(["go", "build", "./..."], cwd=scratch, - capture_output=True, text=True) - if r.returncode == 0: - return [] - pat = re.compile(r"^\.?/?main\.go:(\d+):(?:\d+:)?\s*(.*)$") - out = [] - for ln in (r.stdout + r.stderr).splitlines(): - m = pat.match(ln.strip()) - if not m: - if ln.strip(): - out.append(ln) - continue - gen = int(m.group(1)) - hit = next(((f, la, rl) for f, la, rl in spans if f <= gen <= la), None) - if hit is None: - out.append(ln) - else: - first, _last, readme_line = hit - out.append(f"README.md:{readme_line + gen - first + 1} — {m.group(2)}") - return out - finally: - shutil.rmtree(scratch, ignore_errors=True) - - -CHECKERS = {"javascript": check_javascript, "go": check_go} - - -def main() -> int: - ap = argparse.ArgumentParser(prog="docexamples", description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - sub = ap.add_subparsers(dest="cmd", required=True) - for name, help_ in (("list", "every fence and its marker state"), - ("check", "compile the marked fences")): - p = sub.add_parser(name, help=help_) - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--readme", default="README.md") - - args = ap.parse_args() - repo = Path(args.repo).resolve() - lang = detect(repo) - if not lang: - print(f"{repo.name}: no TypeScript or Go client here — nothing to compile") - return 0 - - readme = repo / args.readme - if not readme.exists(): - die(f"no {args.readme} in {repo}") - found = fences(readme.read_text(), LANGS[lang]["fence"]) - marked = [(line, body) for line, mark, body in found if mark] - - if args.cmd == "list": - print(f"{repo.name} [{lang}] — {len(found)} fence(s), " - f"{len(marked)} marked ({len(marked) * 100 // max(len(found), 1)}%)") - for line, mark, _ in found: - print(f" README.md:{line:<5} {'checked' if mark else '-'}") - return 0 - - if not marked: - print(f"{repo.name} [{lang}] — no fences marked with {MARKER}; nothing to check") - return 0 - - # The docstring promises this "only runs where that toolchain exists"; say so - # instead of letting subprocess raise FileNotFoundError at the reader. - tool = LANGS[lang]["tool"] - if not shutil.which(tool): - die(f"{tool} is not on PATH; `docexamples check` needs the {lang} toolchain") - - problems = CHECKERS[lang](repo, marked) - print(f"{repo.name} [{lang}] — compiled {len(marked)} marked fence(s)") - if problems: - print(f"\n{len(problems)} problem(s):") - for p in problems: - print(f" {p}") - return 1 - print("all marked examples compile") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.claude/skills/seclai-sdk-sync/sdksync.py b/.claude/skills/seclai-sdk-sync/sdksync.py deleted file mode 100755 index 7d3b7ca..0000000 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ /dev/null @@ -1,1278 +0,0 @@ -#!/usr/bin/env python3 -"""Analysis helpers for syncing a Seclai SDK to a new OpenAPI spec. - -Subcommands: - parity spec paths that have no request call in the hand-written client - params query params the client sends that the endpoint does not declare - returns client return types that disagree with the spec's response schema - models hand-written models missing properties their schema declares - surface public API surface diff against a released tag - spec-diff paths and schemas added/removed/changed between two spec revisions - api-delta public client methods added/removed between two git revisions - -Stdlib only, so it runs in every SDK repo regardless of language toolchain. - -Scope: parity and api-delta understand the four SDKs that issue HTTP requests -directly — python, javascript, go, csharp. seclai-cli wraps @seclai/sdk and -seclai-mcp ships no client source, so both are reported as not-applicable -rather than silently passing. -""" -from __future__ import annotations - -import argparse -import json -import re -import subprocess -import sys -from pathlib import Path - -VERBS = ("GET", "POST", "PUT", "PATCH", "DELETE") - -# A quoted path literal. Matched as "everything up to the closing quote" rather -# than a character class: C# interpolations embed calls — -# $"/agents/runs/{Uri.EscapeDataString(runId)}/cancel" — and a class that omits -# parentheses silently fails to match the whole literal, so the path is never -# extracted and the endpoint looks unimplemented. -PATH_LITERAL_RE = r"""(?:"(/[^"\n]*)"|`(/[^`\n]*)`|'(/[^'\n]*)')""" - -# ── Language table ─────────────────────────────────────────────────────────── -# `sources` are HAND-WRITTEN client files only. Generated trees must never be -# scanned: they contain a module per endpoint and would make parity always pass. -# Query-key extraction, used by `params`. Two forms: -# key_re — the key is captured directly (go: q["k"] = ; csharp: ["k"] = ) -# dict_at — the keys live inside a brace-delimited literal that follows an -# anchor. These MUST be sliced by brace matching, not regex: the -# multi-line `params=_strip_none(\n {...}\n)` form defeats a -# non-greedy regex and yields an empty key set, which reads as -# "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. -LANGS = { - "python": { - "sig_re": r"\n (?:async )?def ([a-z]\w*)\(([^)]*)\)\s*->\s*([^:]+):", - "sig_groups": ("name", "params", "ret"), - "detect": "seclai/seclai.py", - "sources": ["seclai/seclai.py"], - "method_re": r"^[ \t]+(?:async )?def ([a-z][a-z0-9_]*)\(", - # Private helpers start with `_` and so never anchor a block of their - # own; without this the public method above them swallows their request - # calls. `api_key`, a plain property, was credited with GET /sources. - "boundary_re": r"^[ \t]*(?:async )?def |^class ", - "verb_re": r'"(GET|POST|PUT|PATCH|DELETE)"', - "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*:', - "skip": {"request", "request_raw", "stream", "paginate"}, - }, - "javascript": { - "sig_re": r"\n (?:async )?(\w+)\(([^)]*)\)\s*:\s*([^{\n]+?)\s*\{", - "sig_groups": ("name", "params", "ret"), - "detect": "src/client.ts", - "sources": ["src/client.ts"], - # Exactly two spaces: class members sit at that indent, while statements - # inside a body sit at four or more. A looser `^[ \t]+` also matches - # `return (await this.request(...)` and attributes findings to "return". - # The indent alone is not enough: the module-level helpers above the class - # put `if (` and `for (` at exactly two spaces as well, and without the - # lookahead `api-delta` lists methods named `if` and `for`. - "method_re": (r"^ (?:async )?\*?" - r"(?!(?:if|for|while|switch|catch|do|else|try|return|new|typeof|await)\b)" - r"([a-zA-Z_][a-zA-Z0-9_]*)\s*[(<]"), - "verb_re": r'"(GET|POST|PUT|PATCH|DELETE)"', - "return_re": r"\s*:\s*([^{\n]+?)\s*\{", - "dict_at": [r"query:\s*"], - "dict_key_re": r'["\']?([a-zA-Z_][a-zA-Z0-9_]*)["\']?\s*:', - "skip": {"request", "requestRaw", "uploadFile", "paginate"}, - }, - "go": { - "sig_re": r"func \(c \*Client\) (\w+)\(([^)]*)\) \(([^)]*)\)", - "sig_groups": ("name", "params", "ret"), - "detect": "client.go", - "sources": ["*.go"], - "exclude": ["*_test.go"], - "method_re": r"^func \(c \*Client\) ([A-Z][A-Za-z0-9]*)\(", - # Free functions and type decls end a block; without this the helpers - # between two client methods are read as part of the earlier one. - "boundary_re": r"^(?:func|type|var|const)\b", - "verb_re": r"http\.Method(Get|Post|Put|Patch|Delete)", - # Go returns `(*T, error)`; take the first element of the tuple. - "return_re": r"\s*\(?\s*([^,{\n]+?)\s*(?:,\s*error)?\s*\)?\s*\{", - "key_re": r'q\["([a-zA-Z_][a-zA-Z0-9_]*)"\]\s*=', - # Go builds a query either by subscript assignment (key_re) or as a map - # literal. Reading only the former made Search and SearchDocs — whose - # required `q` is set in the literal — report as never sending it, the - # false positive twin of the bug this check exists to find. - "dict_at": [r"map\[string\]string"], - "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', - "helpers": {"listQuery(": ["page", "limit"]}, - "skip": {"Do", "buildURL"}, - }, - "csharp": { - "sig_re": r"public (?:async )?([\w<>,?\[\]. ]+?) ([A-Z]\w*)\(([^)]*)\)", - "sig_groups": ("ret", "name", "params"), - "detect": "src/Seclai/SeclaiClient.cs", - "sources": ["src/Seclai/*.cs"], - "method_re": r"public (?:async )?[\w<>,?\[\]. ]+ ([A-Z][A-Za-z0-9]*)\s*\(", - # Same reason as python: only `public` anchors a block, so the private - # Send*/BuildUri helpers fall inside whichever method precedes them. - "boundary_re": r"^ (?:private|internal|protected|static)\b", - "verb_re": r"HttpMethod\.(Get|Post|Put|Patch|Delete)", - # C# puts the return type BEFORE the method name, so unlike the other - # three it is read from the block head, not from after the parameters. - "return_head_re": r"^\s*public (?:async )?(.+?)\s+[A-Z][A-Za-z0-9]*\s*\(", - "key_re": r'\["([a-zA-Z_][a-zA-Z0-9_]*)"\]\s*=', - "helpers": {"PaginationQuery(": ["page", "limit", "sort", "order"]}, - "skip": {"SendJsonAsync", "SendNoContentAsync", "SendRawAsync", "BuildUri", "PaginationQuery"}, - }, -} - -NOT_APPLICABLE = { - "seclai-cli": "wraps @seclai/sdk; coverage is SDK-method-to-command, not spec-path", - "seclai-mcp": "ships no client source", -} - - -def die(msg: str) -> None: - print(f"error: {msg}", file=sys.stderr) - raise SystemExit(2) - - -def detect_lang(repo: Path) -> str | None: - for name, cfg in LANGS.items(): - if (repo / cfg["detect"]).exists(): - return name - return None - - -def source_files(repo: Path, cfg: dict) -> list[Path]: - out: list[Path] = [] - for pat in cfg["sources"]: - out.extend(sorted(repo.glob(pat)) if "*" in pat else ([repo / pat] if (repo / pat).exists() else [])) - for pat in cfg.get("exclude", []): - excl = set(repo.glob(pat)) - out = [p for p in out if p not in excl] - return out - - -def normalise(path: str) -> str: - """Collapse every placeholder form to `{}` so paths compare across languages.""" - path = re.sub(r"\$\{[^}]*\}", "{}", path) # JS template ${agentId} - path = re.sub(r"\{[^}]*\}", "{}", path) # py f-string / C# interpolation / spec - path = re.sub(r"%[sdv]", "{}", path) # go fmt.Sprintf - return path.rstrip("/") or "/" - - -def extract_paths(text: str, verb_re: str) -> dict[str, set[str]]: - """Map normalised path -> set of verbs seen near its occurrences. - - Verb association is best-effort: it scans a window around each occurrence. - Absence of a verb is reported as a warning, never as a hard miss. - """ - found: dict[str, set[str]] = {} - for m in re.finditer(PATH_LITERAL_RE, text): - p = normalise(next(g for g in m.groups() if g is not None)) - if p == "/" or not p.startswith("/"): - continue - window = text[max(0, m.start() - 220): m.end() + 60] - verbs = {v.upper() for v in re.findall(verb_re, window)} - found.setdefault(p, set()).update(verbs) - return found - - -def load_spec(ref: str | None, path: str, repo: Path) -> dict: - if ref: - try: - blob = subprocess.check_output( - ["git", "-C", str(repo), "show", f"{ref}:{path}"], stderr=subprocess.DEVNULL) - except subprocess.CalledProcessError: - die(f"cannot read {path} at {ref}") - return json.loads(blob) - f = Path(path) if Path(path).is_absolute() else repo / path - if not f.exists(): - die(f"no spec at {f}\n" - " Only seclai-python, seclai-javascript and seclai-go bundle the spec.\n" - " For the others, point at one explicitly, e.g.\n" - " --spec ../seclai-python/openapi/seclai.openapi.json") - return json.loads(f.read_text()) - - -# ── params ─────────────────────────────────────────────────────────────────── -def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> str | None: - """Return the brace-delimited literal starting at or after `at`. - - Regex cannot do this: query literals span lines and nest, and a non-greedy - match silently truncates at the first inner `}`. - """ - i = text.find(opener, at) - if i == -1: - return None - depth, j = 0, i - while j < len(text): - if text[j] == opener: - depth += 1 - elif text[j] == closer: - depth -= 1 - if depth == 0: - return text[i + 1: j] - j += 1 - return None - - -def split_args(sig: str) -> list[str]: - """Split a comma-separated argument or parameter list at depth 0. - - A naive `split(",")` turns `Dictionary q` into two entries, - which over-counts arity for the query helpers and reports a phantom - signature change for `surface`. - """ - out, depth, cur = [], 0, "" - for ch in sig: - if ch in "<([{": - depth += 1 - elif ch in ">)]}": - depth -= 1 - if ch == "," and depth == 0: - out.append(cur.strip()) - cur = "" - else: - cur += ch - if cur.strip(): - out.append(cur.strip()) - return [p for p in out if p and p != "*"] - - -def spec_query_index(spec: dict) -> dict[tuple[str, str], tuple[str, set[str], set[str]]]: - """(VERB, normalised path) -> (raw path, declared query names, required names). - - Resolves `$ref` against components.parameters and merges path-level params - into each operation, both of which the spec uses. - """ - comp = spec.get("components", {}).get("parameters", {}) - - def resolve(p: dict) -> dict: - ref = p.get("$ref") - if ref and ref.startswith("#/components/parameters/"): - return comp.get(ref.rsplit("/", 1)[-1], {}) - return p - - index: dict[tuple[str, str], tuple[str, set[str], set[str]]] = {} - for raw, ops in spec.get("paths", {}).items(): - shared = [resolve(p) for p in ops.get("parameters", [])] - for verb, op in ops.items(): - if verb not in ("get", "post", "put", "patch", "delete"): - continue - params = shared + [resolve(p) for p in op.get("parameters", [])] - q = {p["name"] for p in params if p.get("in") == "query" and "name" in p} - req = {p["name"] for p in params - if p.get("in") == "query" and p.get("required") and "name" in p} - index[(verb.upper(), normalise(raw))] = (raw, q, req) - return index - - -def method_blocks(text: str, method_re: str, boundary_re: str | None = None): - """Yield (name, body). Each block ends at the next method OR declaration. - - Ending only at the next *method* anchor makes a block swallow everything - between two methods, so any free function declared in the gap is attributed - to the method above it. In seclai-go that made `GetMe` — which sends no query - at all — appear to send page/limit/sort/order, because the `listQuery` and - `sortableListQuery` helpers sit between it and the next client method. Four - of six reported Go errors were that one artefact, and a check that cries wolf - is a check somebody turns off. - """ - ms = list(re.finditer(method_re, text, re.M)) - bounds = [m.start() for m in re.finditer(boundary_re, text, re.M)] if boundary_re else [] - for i, m in enumerate(ms): - end = ms[i + 1].start() if i + 1 < len(ms) else len(text) - nxt = next((b for b in bounds if b > m.start()), None) - if nxt is not None: - end = min(end, nxt) - yield m.group(1), text[m.start():end] - - -def block_call(body: str, verb_re: str) -> tuple[str, str] | None: - """First (VERB, normalised path) issued inside a method body. - - The path must appear AFTER the verb: taking the first path-like literal - anywhere in the block picks up example paths out of docstrings and prose. - """ - v = re.search(verb_re, body) - if not v: - return None - p = re.search(PATH_LITERAL_RE, body[v.end():v.end() + 400]) - if not p: - return None - path = normalise(next(g for g in p.groups() if g is not None)) - if path == "/": - return None - return v.group(1).upper(), path - - -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".""" - keys: set[str] = set() - ok = True - - for anchor, ordered in (cfg.get("helpers") or {}).items(): - for m in re.finditer(re.escape(anchor), body): - args = balanced_slice(body, m.end() - 1, "(", ")") - if args is None: - ok = False - continue - keys |= set(ordered[:len(split_args(args))]) - - if "key_re" in cfg: - keys |= set(re.findall(cfg["key_re"], body)) - - indirect = False - for anchor in cfg.get("dict_at", []): - for m in re.finditer(anchor, body): - rest = body[m.end():] - stripped = rest.lstrip() - if not stripped.startswith("{"): - # `params=params` / `query: someVar` — a reference, not a literal. - # Not readable here, but the literal is usually assigned earlier in - # the same block, so only treat it as unaudited if nothing was found. - indirect = True - continue - lit = balanced_slice(body, m.end()) - if lit is None: - ok = False - continue - keys |= set(re.findall(cfg["dict_key_re"], lit)) - - if indirect and not keys: - ok = False - return keys, ok - - -def cmd_params(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - - spec = load_spec(args.rev, args.spec, repo) - index = spec_query_index(spec) - - 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)))) - - print(f"{name} [{lang}] — {len(files)} client file(s), " - f"{len(index)} spec operations") - - if undeclared: - print(f"\nUNDECLARED ({len(undeclared)}) — sent but the endpoint does not accept it:") - for m, op, k, decl in sorted(undeclared): - print(f" {m} ({op})") - print(f" sends: {k}") - print(f" accepts: {', '.join(decl) or '(none)'}") - - if not_in_spec: - print(f"\nNOT IN SPEC ({len(not_in_spec)}) — client calls a path the spec does not declare:") - for m, op in sorted(not_in_spec): - print(f" {m} ({op})") - - if missing_required: - print(f"\nMISSING REQUIRED ({len(missing_required)}) — the endpoint requires this" - f" and no code path sends it:") - for m, op, k in sorted(missing_required): - print(f" {m} ({op}) needs: {k}") - - if unparsed: - print(f"\nUNPARSED ({len(unparsed)}) — query construction could not be read;" - f" treat as unaudited, not as clean:") - for m, op in sorted(unparsed): - print(f" {m} ({op})") - - if not args.quiet_unexposed: - gaps = [] - for (verb, _npath), (raw, declared, _req) in index.items(): - got = exposed.get((verb, raw)) - if got is None: - continue # endpoint not implemented at all — parity's job - missing = declared - got - if missing: - gaps.append((f"{verb} {raw}", sorted(missing))) - if gaps: - print(f"\nUNEXPOSED ({len(gaps)}) — declared query params no method sends:") - for op, names in sorted(gaps): - print(f" {op}: {', '.join(names)}") - - # A method whose query could not be read AND whose path is not in the spec is - # one problem, not two; counting it twice inflated the gate's error total. - errors = (len(undeclared) + len(not_in_spec) + len(missing_required) - + len(unparsed - not_in_spec)) - print() - if errors: - print(f"{errors} error(s)") - return 1 - print("no parameter mismatches") - return 0 - - -# ── parity ─────────────────────────────────────────────────────────────────── -def cmd_parity(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo} (looked for " - + ", ".join(c["detect"] for c in LANGS.values()) + ")") - cfg = LANGS[lang] - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - - spec = load_spec(args.rev, args.spec, repo) - text = "\n".join(f.read_text(errors="replace") for f in files) - impl = extract_paths(text, cfg["verb_re"]) - - missing, partial = [], [] - total = 0 - for p, ops in sorted(spec.get("paths", {}).items()): - verbs = {v.upper() for v in ops if v in ("get", "post", "put", "patch", "delete")} - if not verbs: - continue - total += len(verbs) - norm = normalise(p) - if norm not in impl: - missing += [f"{v} {p}" for v in sorted(verbs)] - else: - seen = impl[norm] - if seen and not verbs <= seen: - partial += [f"{v} {p}" for v in sorted(verbs - seen)] - - print(f"{name} [{lang}] — {len(files)} client file(s), " - f"{total} spec operations across {len(spec.get('paths', {}))} paths") - if missing: - print(f"\nMISSING — no request call for this path ({len(missing)}):") - for m in missing: - print(f" {m}") - if partial and not args.quiet_partial: - print(f"\nverb not detected near an existing path ({len(partial)}) " - f"— best-effort, verify by hand:") - for m in partial: - print(f" {m}") - if not missing: - print("\nfull path parity") - return 1 if missing else 0 - - -# ── spec-diff ──────────────────────────────────────────────────────────────── -def _schema_label(sch: dict | None) -> str: - """A short, comparable name for a response/request schema.""" - if not sch: - return "none" - if "$ref" in sch: - return sch["$ref"].rsplit("/", 1)[-1] - if sch.get("type") == "array": - return f"array<{_schema_label(sch.get('items'))}>" - if sch.get("type") == "object" or "properties" in sch: - return "object" - return sch.get("type", "unknown") - - -def _json_schema(op: dict, section: str, code: str | None = None) -> dict | None: - node = op.get("requestBody") if section == "request" else op.get("responses", {}).get(code, {}) - return (node or {}).get("content", {}).get("application/json", {}).get("schema") - - -def diff_operation(old: dict, new: dict, path: str, verb: str, - old_q: dict | None = None, new_q: dict | None = None) -> list[str]: - """What actually changed on one operation, beyond its prose. - - `old_q`/`new_q` are prebuilt `spec_query_index` results. Rebuilding them here - walks and $ref-resolves the whole 124-path spec twice for every changed - operation; the caller builds them once. - - The original implementation labelled every non-verb change - "description/params only", which reads as "nothing to do". In the 2026-07 - fast-follow two endpoints silently changed their 200 body from a bare array - to a paginated envelope — a change that breaks every shipped client at - runtime — and the tool reported them as prose edits. Anything a client can - observe gets named here; only genuine prose edits fall through to "docs only". - """ - old_q = spec_query_index(old) if old_q is None else old_q - new_q = spec_query_index(new) if new_q is None else new_q - lo = old_q.get((verb, normalise(path))) - ln = new_q.get((verb, normalise(path))) - oop = old["paths"][path][verb.lower()] - nop = new["paths"][path][verb.lower()] - out: list[str] = [] - - if lo and ln: - _, oq, oreq = lo - _, nq, nreq = ln - if nq - oq: - out.append("+query " + ", ".join(sorted(nq - oq))) - if oq - nq: - out.append("-query " + ", ".join(sorted(oq - nq))) - for name in sorted((nreq - oreq) & (oq & nq)): - out.append(f"~query {name} is now required") - for name in sorted((oreq - nreq) & (oq & nq)): - out.append(f"~query {name} is no longer required") - - ob, nb = _schema_label(_json_schema(oop, "request")), _schema_label(_json_schema(nop, "request")) - if ob != nb: - out.append(f"~request {ob} -> {nb}") - - for code in sorted(set(oop.get("responses", {})) | set(nop.get("responses", {}))): - if code.startswith("4") or code.startswith("5"): - continue - a = _schema_label(_json_schema(oop, "response", code)) - b = _schema_label(_json_schema(nop, "response", code)) - if a != b: - out.append(f"~response {code}: {a} -> {b}") - return out - - -def cmd_spec_diff(args) -> int: - repo = Path(args.repo).resolve() - old = load_spec(args.old, args.spec, repo) - new = load_spec(args.new, args.spec, repo) if args.new else load_spec(None, args.spec, repo) - - op, np_ = set(old.get("paths", {})), set(new.get("paths", {})) - os_, ns_ = set(old.get("components", {}).get("schemas", {})), set(new.get("components", {}).get("schemas", {})) - - def ops(spec, p): - return sorted(v.upper() for v in spec["paths"][p] if v in ("get", "post", "put", "patch", "delete")) - - print(f"paths: {len(op)} -> {len(np_)} schemas: {len(os_)} -> {len(ns_)}") - - if np_ - op: - print(f"\nADDED PATHS ({len(np_ - op)}):") - for p in sorted(np_ - op): - print(f" {p} [{', '.join(ops(new, p))}]") - if op - np_: - print(f"\nREMOVED PATHS ({len(op - np_)}):") - for p in sorted(op - np_): - print(f" {p}") - - changed, breaking = [], 0 - old_q, new_q = spec_query_index(old), spec_query_index(new) - for p in sorted(np_ & op): - if json.dumps(old["paths"][p], sort_keys=True) == json.dumps(new["paths"][p], sort_keys=True): - continue - oo, nn = set(ops(old, p)), set(ops(new, p)) - lines = [] - if nn - oo: - lines.append("+verbs " + ", ".join(sorted(nn - oo))) - if oo - nn: - lines.append("-verbs " + ", ".join(sorted(oo - nn))) - for verb in sorted(oo & nn): - lines += [f"{verb} {d}" - for d in diff_operation(old, new, p, verb, old_q, new_q)] - breaking += sum(1 for ln in lines if "~response" in ln or ln.startswith("-verbs")) - changed.append(f" {p}" + ("\n" + "\n".join(f" {ln}" for ln in lines) if lines - else " (docs only)")) - if changed: - print(f"\nCHANGED PATHS ({len(changed)}):") - print("\n".join(changed)) - if breaking: - print(f"\n !! {breaking} response/verb change(s) above can break a shipped client.") - print(" Check the SDK's declared return type, not just its query params.") - - if ns_ - os_: - print(f"\nADDED SCHEMAS ({len(ns_ - os_)}):") - for s in sorted(ns_ - os_): - print(f" {s}") - if os_ - ns_: - print(f"\nREMOVED SCHEMAS ({len(os_ - ns_)}):") - for s in sorted(os_ - ns_): - print(f" {s}") - - ov = old.get("x-seclai-versions") or {} - nv = new.get("x-seclai-versions") or {} - if ov != nv: - print("\nAPI VERSIONS CHANGED:") - for key in ("default", "latest"): - if ov.get(key) != nv.get(key): - print(f" {key}: {ov.get(key)} -> {nv.get(key)}") - gained = [v for v in nv.get("known", []) if v not in ov.get("known", [])] - if gained: - print(f" +known {', '.join(gained)}") - print(" Each SDK pins these as constants and rejects an unknown version, so " - "update them\n or the new version cannot be selected. Their tests assert " - "the constants match this block.") - - prop_changes = [] - for k in sorted(ns_ & os_): - o = set((old["components"]["schemas"][k].get("properties") or {})) - n = set((new["components"]["schemas"][k].get("properties") or {})) - if o != n: - bits = [] - if n - o: - bits.append("+" + ",".join(sorted(n - o))) - if o - n: - bits.append("-" + ",".join(sorted(o - n))) - prop_changes.append(f" {k}: {' '.join(bits)}") - if prop_changes: - print(f"\nSCHEMA PROPERTY CHANGES ({len(prop_changes)}):") - print("\n".join(prop_changes)) - return 0 - - -# ── api-delta ──────────────────────────────────────────────────────────────── -def verify_rev(repo: Path, rev: str | None) -> None: - """Fail loudly on an unresolvable rev. - - Without this, an unreadable rev yields an empty method set and the delta - reports every method in the SDK as newly added — a confident wrong answer. - """ - if rev is None: - return - r = subprocess.run(["git", "-C", str(repo), "rev-parse", "--verify", "--quiet", f"{rev}^{{commit}}"], - capture_output=True, text=True) - if r.returncode != 0: - die(f"not a git revision in {repo.name}: {rev!r}") - - -def methods_at(repo: Path, rev: str | None, cfg: dict, files: list[Path]) -> set[str]: - names: set[str] = set() - for f in files: - rel = f.relative_to(repo) - if rev: - try: - text = subprocess.check_output( - ["git", "-C", str(repo), "show", f"{rev}:{rel}"], - stderr=subprocess.DEVNULL).decode("utf-8", "replace") - except subprocess.CalledProcessError: - continue - else: - text = f.read_text(errors="replace") - for m in re.finditer(cfg["method_re"], text, re.M): - n = m.group(1) - if not n.startswith("_"): - names.add(n) - return names - - -def cmd_api_delta(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - files = source_files(repo, cfg) - - verify_rev(repo, args.old) - verify_rev(repo, args.new) - old = methods_at(repo, args.old, cfg, files) - new = methods_at(repo, args.new, cfg, files) - - added, removed = sorted(new - old), sorted(old - new) - label_new = args.new or "working tree" - print(f"{name} [{lang}] {args.old} -> {label_new}") - print(f"\nADDED ({len(added)}):") - for n in added: - print(f" {n}") - if removed: - print(f"\nREMOVED ({len(removed)}):") - for n in removed: - print(f" {n}") - print("\n note: a name in both lists was renamed or re-signatured, not deleted —" - "\n check the signature diff before writing a Removed changelog entry.") - return 0 - - -# ── returns ────────────────────────────────────────────────────────────────── -# The third axis. `parity` walks spec->client paths, `params` walks client->spec -# query keys, and neither can see a response shape. In 2026-07 two endpoints -# changed their 200 body from a bare array to a paginated envelope; every shipped -# SDK still declared a list, so all four broke at runtime and both checks stayed -# green. This compares the client's DECLARED return type against the spec's. - -# Untyped escape hatches. Returning one is legal but means the caller gets no -# help from the compiler, so it is reported as a warning when the spec has a name. -UNTYPED = { - "csharp": {"JsonElement", "JsonDocument", "object", "string", "Stream", "byte[]"}, - "go": {"json.RawMessage", "any", "interface{}", "map[string]any", "[]byte"}, - "python": {"Any", "dict", "dict[str, Any]", "Dict[str, Any]", "object", "bytes", - "JSONValue", "JSONObject"}, - "javascript": {"unknown", "any", "object", "Blob", "ArrayBuffer", "string"}, -} -NO_RETURN = {"csharp": {"Task", "void"}, "go": {"error", ""}, - "python": {"None"}, "javascript": {"void"}} - - -def short_label(label: str) -> str: - """Drop the spec's module qualification: `routers__api__agents__X` -> `X`. - - No SDK reproduces that qualification in its own type names, so comparing the - full name marks every qualified schema as a mismatch — 38 of 38 C# findings - on the first run, which is a broken check rather than a broken SDK. - """ - m = re.match(r"^array<(.+)>$", label) - if m: - return f"array<{short_label(m.group(1))}>" - return label.rsplit("__", 1)[-1] - - -def strip_generated_prefix(name: str) -> str: - """`RoutersApiAgentsSetEmailTriggerConfigRequest` -> the spec's short name. - - oapi-codegen flattens the spec's `routers__api__agents__X` qualification into - the type name, so a literal comparison against the schema name never matches. - """ - return re.sub(r"^Routers(?:Api|Authenticated)[A-Z][a-zA-Z]*?(?=[A-Z])", "", name) - - -def normalise_type(t: str, lang: str) -> str: - """A client return type expressed the way `_schema_label` labels a schema.""" - t = t.strip().rstrip(";").strip() - for wrapper in (r"^Task<(.+)>$", r"^Promise<(.+)>$", r"^Awaitable\[(.+)\]$"): - m = re.match(wrapper, t) - if m: - t = m.group(1).strip() - t = t.lstrip("*&").replace(" | null", "").replace(" | undefined", "") - t = re.sub(r"\s*\|\s*None$", "", t) - t = t.rstrip("?") - # The escape hatches come FIRST. `byte[]` and `[]byte` are whole-blob - # returns, but they also match the array patterns below, so testing shape - # first turned every binary endpoint into an `array` and graded it a - # SHAPE MISMATCH against the spec's object — a hard error, exit 1, on code - # that is correct. Nothing in UNTYPED is a real list, so this cannot mask - # `list[dict[str, Any]]`, which is not in the table. - if t in NO_RETURN.get(lang, set()): - return "none" - if t in UNTYPED.get(lang, set()): - return "?" - for arr in (r"^List<(.+)>$", r"^IReadOnlyList<(.+)>$", r"^\[\](.+)$", - r"^list\[(.+)\]$", r"^List\[(.+)\]$", r"^(.+)\[\]$"): - m = re.match(arr, t) - if m: - return f"array<{normalise_type(m.group(1), lang)}>" - return strip_generated_prefix(t) - - -def block_return(body: str, cfg: dict) -> str | None: - """The declared return type of the method a block starts with. - - Read by slicing the parameter list with paren matching rather than by regex: - signatures wrap across lines and contain nested parens and generics, both of - which truncate a regex silently — and a silent truncation here reads as - "this method declares nothing to check". - """ - if "return_head_re" in cfg: - m = re.match(cfg["return_head_re"], body, re.S) - return m.group(1).strip() if m else None - # Start at the paren the method anchor itself ends on. Taking the first `(` - # in the block instead picks up Go's receiver — `func (c *Client) GetMe(` — - # so the "return type" came back as the rest of the signature. - anchor = re.match(cfg["method_re"], body, re.M) - if not anchor: - return None - open_paren = body.find("(", anchor.end() - 1) - if open_paren == -1: - return None - params = balanced_slice(body, open_paren, "(", ")") - if params is None: - return None - rest = body[open_paren + len(params) + 2:] - m = re.match(cfg["return_re"], rest, re.S) - return m.group(1).strip() if m else None - - -def cmd_returns(args) -> int: - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - if "return_re" not in cfg and "return_head_re" not in cfg: - print(f"{repo.name} [{lang}] — return types are not declared; nothing to check.") - return 0 - files = source_files(repo, cfg) - if not files: - # Silence here is a false pass: no sources means no methods means - # "nothing disagrees with the spec", which is what a mis-pointed repo - # argument looks like. - die(f"no client sources found for {lang} in {repo}") - spec = load_spec(args.rev, args.spec, repo) - - want: dict[tuple[str, str], str] = {} - for raw, ops in spec.get("paths", {}).items(): - for verb, op in ops.items(): - if verb not in ("get", "post", "put", "patch", "delete"): - continue - for code in ("200", "201", "202"): - if code in op.get("responses", {}): - want[(verb.upper(), normalise(raw))] = short_label( - _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)) - - print(f"{repo.name} [{lang}] — {n} method(s) with both a declared return type " - f"and a named response schema") - - if mismatched: - print(f"\nSHAPE MISMATCH ({len(mismatched)}) — list vs object; this fails at deserialization:") - for name, (verb, p), expect, declared in mismatched: - print(f" {name} ({verb} {p})\n spec: {expect}\n code: {declared}") - if renamed and not args.quiet_renamed: - print(f"\nWARN — NAME DIFFERS ({len(renamed)}) — same shape, different type name:") - for name, (verb, p), expect, declared in renamed: - print(f" {name} ({verb} {p}): {declared}, spec calls it {expect}") - if untyped and not args.quiet_untyped: - print(f"\nWARN — UNTYPED ({len(untyped)}) — spec names a schema, the client returns a blob:") - for name, (verb, p), expect, declared in untyped: - print(f" {name} ({verb} {p}): {declared}, spec declares {expect}") - - if mismatched: - print(f"\n{len(mismatched)} return type(s) disagree with the spec in SHAPE.") - return 1 - print("\nno return type disagrees with the spec in shape") - return 0 - - - -# ── surface ────────────────────────────────────────────────────────────────── -def public_surface(text: str, cfg: dict) -> dict[str, set[tuple[str, str]]]: - """method name -> {(return type, parameter list)}. A set, because C# and Go - both allow overloads/variants under one name.""" - out: dict[str, set[tuple[str, str]]] = {} - order = cfg["sig_groups"] - - def norm(x: str | None) -> str: - return " ".join((x or "").split()) - - for m in re.finditer(cfg["sig_re"], text, re.S): - parts = dict(zip(order, m.groups())) - out.setdefault(norm(parts["name"]), set()).add((norm(parts["ret"]), norm(parts["params"]))) - return out - - - -# Kept as an alias: the tests and the older call sites name it `_params`. -_params = split_args - - -def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tuple[str, str]: - """(severity, label) for one signature change. severity is 'break' or 'warn'. - - Not every signature change breaks a caller, and a check that says it does is - a check people switch off. Narrowing a return from `unknown` to a concrete - type is safe for every TypeScript consumer; a Python return annotation is not - enforced at all. Adding an optional parameter still compiles everywhere — but - it changes the method's metadata token, so a C# consumer that does not - recompile breaks at runtime. That last case is real and easy to miss. - """ - old_ret, old_par = old - new_ret, new_par = new - if old_par != new_par: - op, np_ = split_args(old_par), split_args(new_par) - # `len(np_) > len(op)` matters: `split_args` drops Python's bare `*`, so - # `f(self, a, b)` -> `f(self, a, *, b)` yields two IDENTICAL lists, the - # empty tail passes `all()` vacuously, and making a parameter - # keyword-only — which breaks every positional caller — was graded - # "optional parameters added — source compatible". - added_optional = (len(np_) > len(op) - and np_[:len(op)] == op - and all("=" in a for a in np_[len(op):])) - if added_optional: - if lang == "csharp": - return "warn", "optional parameters added — source compatible, but binary breaking for consumers that do not recompile" - return "warn", "optional parameters added — source compatible" - return "break", "parameter list changed" - if old_ret != new_ret: - if lang == "javascript" and "unknown" in old_ret and "unknown" not in new_ret: - return "warn", "return narrowed from unknown — safe for consumers" - if lang == "python": - return "warn", "return annotation changed — not enforced at runtime, but check the value did not change" - return "break", "return type changed" - return "warn", "signature reordered" - - -def cmd_surface(args) -> int: - """Diff the public API surface against a released tag. - - The check that answers "is this release breaking?". Reading the changelog - cannot answer it, and neither can the compiler: adding an optional parameter - in C# still compiles for every caller but breaks any consumer that does not - recompile. That is exactly how a binary-breaking change reached an - otherwise-additive release in 2026-07. - """ - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - if "sig_re" not in cfg: - print(f"{repo.name} [{lang}] — no signature pattern; nothing to compare.") - return 0 - verify_rev(repo, args.rev) - - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - rel = [str(f.relative_to(repo)) for f in files] - # `verify_rev` proves the rev resolves; it does not prove the sources existed - # under these paths back then. A rename since the tag makes every `git show` - # fail, and swallowing that yields an empty baseline — zero removed, zero - # changed, "no breaking change" — the same confident wrong answer one level - # down. Joined with newlines so the last line of one file cannot merge with - # the first line of the next. - old_parts = [] - for r in rel: - p = subprocess.run(["git", "-C", str(repo), "show", f"{args.rev}:{r}"], - capture_output=True, text=True) - if p.returncode == 0: - old_parts.append(p.stdout) - if not old_parts: - die(f"none of the client sources exist at {args.rev} in {repo.name} " - f"({', '.join(rel)}) — were they renamed since the tag?") - old_text = "\n".join(old_parts) - new_text = "\n".join(f.read_text(encoding="utf-8", errors="replace") for f in files) - - old, new = public_surface(old_text, cfg), public_surface(new_text, cfg) - removed = sorted(set(old) - set(new)) - added = sorted(set(new) - set(old)) - changed = [k for k in sorted(set(old) & set(new)) if old[k] - new[k]] - - print(f"{repo.name} [{lang}] — {len(old)} public method(s) at {args.rev}, {len(new)} now") - - if removed: - print(f"\nREMOVED ({len(removed)}) — every caller breaks:") - for k in removed: - print(f" {k}") - breaks, warns = [], [] - for k in changed: - gone = sorted(old[k] - new[k]) - now = sorted(new[k] - old[k]) - sev, label = ("break", "signature removed") - if len(gone) == 1 and len(now) == 1: - sev, label = classify_change(lang, gone[0], now[0]) - (breaks if sev == "break" else warns).append((k, label, gone, now)) - - def show(rows: list) -> None: - for k, label, gone, now in rows: - print(f" {k} — {label}") - for ret, params in gone: - print(f" was: {ret} ({params[:100]})") - for ret, params in now: - print(f" now: {ret} ({params[:100]})") - - if breaks: - print(f"\nBREAKING ({len(breaks)}) — a released signature no longer works:") - show(breaks) - if warns and not args.quiet_warn: - print(f"\nWARN — CHANGED ({len(warns)}) — compatible, but verify:") - show(warns) - if added and not args.quiet_added: - print(f"\nADDED ({len(added)}):") - print(" " + ", ".join(added)) - - if removed or breaks: - print(f"\n{len(removed) + len(breaks)} breaking change(s). Keep the old form and add " - "alongside it, or bump the major.") - return 1 - print("\nno breaking change — every released signature still works") - return 0 - - -# ── Model completeness ─────────────────────────────────────────────────────── -# Only for SDKs whose models are written by hand. Where a generator owns the -# models, regeneration keeps them in step and this check has nothing to say. -MODEL_LANGS = { - "csharp": { - "glob": "src/Seclai/Models/*.cs", - "class_re": r"public (?:sealed |abstract )?class (\w+)", - "prop_re": r'\[JsonPropertyName\("([^"]+)"\)\]', - }, -} - - -def git_location(spec: Path, fallback: Path) -> tuple[Path, str]: - """(git work tree, path relative to its root) for a spec file. - - `git show REV:path` resolves `path` from the repo ROOT, so pointing -C at - the file's own directory silently fails. seclai-csharp bundles no spec and - is always audited with --spec pointing into seclai-python, so this is the - normal case, not the edge case. - - A RELATIVE path is resolved against `fallback` first, exactly as `load_spec` - resolves it. `--spec ../seclai-python/openapi/seclai.openapi.json` is the - form `load_spec`'s own error message recommends, and treating it as - repo-root-relative sent `git show` looking for `../seclai-python/...` inside - seclai-csharp, so `models --since` died on the one workflow it exists for. - """ - full = spec if spec.is_absolute() else (fallback / spec) - if not full.exists(): - # Nothing on disk to locate; assume repo-root-relative, as before. - return fallback, str(spec) - try: - top = subprocess.check_output( - ["git", "-C", str(full.parent), "rev-parse", "--show-toplevel"], - stderr=subprocess.DEVNULL, text=True).strip() - except (subprocess.CalledProcessError, FileNotFoundError): - die(f"{full} is not inside a git work tree; --since needs one") - root = Path(top) - try: - return root, str(full.resolve().relative_to(root.resolve())) - except ValueError: - die(f"{full} resolves outside its own work tree {root}; --since cannot read it") - - -def spec_schema_index(spec: dict) -> dict[str, list[tuple[str, set[str]]]]: - """Short schema name -> [(full name, property names)]. - - The spec qualifies some schemas by module (`routers__api__agents__X`), and - two modules can export the same trailing name, so a short name may resolve - to more than one schema. - """ - index: dict[str, list[tuple[str, set[str]]]] = {} - for full, sch in (spec.get("components", {}).get("schemas") or {}).items(): - short = full.rsplit("__", 1)[-1] - index.setdefault(short, []).append((full, set(sch.get("properties") or {}))) - return index - - -def cmd_models(args) -> int: - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - # `MODEL_LANGS.get(None)` is None, so without this an undetectable repo - # printed "models are generated; nothing to check" and exited 0. - die(f"cannot detect SDK language in {repo}") - cfg = MODEL_LANGS.get(lang) - if not cfg: - print(f"{repo.name} [{lang}] — models are generated; nothing to check by hand.") - return 0 - - spec = load_spec(args.rev, args.spec, repo) - index = spec_schema_index(spec) - - # `--since` narrows the report to properties the schema GAINED since a rev. - # Without it the C# models show 27 findings, every one a coverage gap that - # predates this sync — a signal nobody can act on, and a gate nobody keeps. - # With it the question becomes the one that actually bit: did this sync - # leave a model behind? Six were, in 2026-07, and only review caught them. - gained: dict[str, set[str]] | None = None - if args.since: - spec_repo, rel = git_location(Path(args.spec), repo) - before = spec_schema_index(load_spec(args.since, rel, spec_repo)) - gained = {} - for short, cands in index.items(): - now = set.union(*(p for _, p in cands)) - was = set.union(*(p for _, p in before[short])) if short in before else set() - if now - was: - gained[short] = now - was - - files = sorted(repo.glob(cfg["glob"])) - scope = f", {len(gained)} schema(s) changed since {args.since}" if gained is not None else "" - print(f"{repo.name} [{lang}] — {len(files)} model file(s), {len(index)} spec schema names{scope}") - - missing, extra, unmatched = [], [], [] - for f in files: - text = f.read_text(encoding="utf-8", errors="replace") - m = re.search(cfg["class_re"], text) - if not m: - continue - cls = m.group(1) - have = set(re.findall(cfg["prop_re"], text)) - cands = index.get(cls) - if not cands: - unmatched.append(cls) - continue - # With more than one candidate, only properties common to all of them are - # unambiguously missing. A gate that guesses is a gate that gets muted. - want = set.intersection(*(p for _, p in cands)) - if gained is not None: - want &= gained.get(cls, set()) - gone = want - have - if gone: - missing.append((cls, sorted(gone), [n for n, _ in cands])) - if len(cands) == 1 and gained is None: - surplus = have - cands[0][1] - if surplus: - extra.append((cls, sorted(surplus))) - - if missing: - print(f"\nMISSING PROPERTIES ({len(missing)}) — the spec declares these and the model does not:") - for cls, props, full in missing: - where = f" [{', '.join(full)}]" if full != [cls] else "" - print(f" {cls}{where}\n {', '.join(props)}") - if extra: - print(f"\nWARN — EXTRA PROPERTIES ({len(extra)}) — in the model, not in the schema:") - for cls, props in extra: - print(f" {cls}: {', '.join(props)}") - if unmatched and not args.quiet_unmatched and gained is None: - print(f"\nWARN — NOT IN SPEC ({len(unmatched)}) — model classes with no matching schema:") - print(" " + ", ".join(sorted(unmatched))) - - if unmatched: - # Not a finding: the spec declares some request bodies inline rather than - # as a named component, so CreateSourceRequest and UpdateSourceRequest — - # both of which WERE left stale in 2026-07 — have nothing to match - # against. Say so, so the count is never read as full coverage. - print(f"\n note: {len(unmatched)} model class(es) have no named schema " - f"and are unchecked (inline request bodies land here).") - - if missing: - print(f"\n{len(missing)} model(s) behind the spec.") - return 1 - print("\nall models carry every property their schema declares") - return 0 - - -def main() -> int: - ap = argparse.ArgumentParser(prog="sdksync", description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - sub = ap.add_subparsers(dest="cmd", required=True) - - p = sub.add_parser("parity", help="spec paths with no request call in the client") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-partial", action="store_true", help="suppress the best-effort verb warnings") - p.set_defaults(func=cmd_parity) - - p = sub.add_parser("params", help="query params the client sends that the endpoint does not declare") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-unexposed", action="store_true", - help="suppress the declared-but-never-sent report") - p.set_defaults(func=cmd_params) - - p = sub.add_parser("returns", help="client return types that disagree with the spec response") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-untyped", action="store_true", - help="suppress the returns-a-blob report") - p.add_argument("--quiet-renamed", action="store_true", - help="suppress the same-shape-different-name report") - p.set_defaults(func=cmd_returns) - - p = sub.add_parser("surface", help="public API surface diff against a released tag") - p.add_argument("rev", help="git rev of the last release, e.g. 1.3.0 or v1.5.0") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-added", action="store_true", help="suppress the added-methods list") - p.add_argument("--quiet-warn", action="store_true", help="suppress the compatible-change report") - p.set_defaults(func=cmd_surface) - - p = sub.add_parser("models", help="hand-written models missing properties their schema declares") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--since", metavar="REV", - help="only report properties the schema gained since this spec rev " - "(the sync gate; without it every long-standing gap is listed)") - p.add_argument("--quiet-unmatched", action="store_true", - help="suppress the model-classes-with-no-schema report") - p.set_defaults(func=cmd_models) - - p = sub.add_parser("spec-diff", help="paths/schemas added, removed or changed between revisions") - p.add_argument("old", help="git rev of the older spec") - p.add_argument("new", nargs="?", help="git rev of the newer spec (default: working tree)") - p.add_argument("--repo", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.set_defaults(func=cmd_spec_diff) - - p = sub.add_parser("api-delta", help="public client methods added/removed between revisions") - p.add_argument("old", help="git rev") - p.add_argument("new", nargs="?", help="git rev (default: working tree)") - p.add_argument("--repo", default=".") - p.add_argument("--lang", choices=list(LANGS)) - p.set_defaults(func=cmd_api_delta) - - args = ap.parse_args() - return args.func(args) - - -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-changelog/SKILL.md b/SKILL.md similarity index 100% rename from .claude/skills/seclai-changelog/SKILL.md rename to SKILL.md 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/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() diff --git a/.claude/skills/seclai-changelog/validate.py b/validate.py similarity index 100% rename from .claude/skills/seclai-changelog/validate.py rename to validate.py From 8fc604032e39af7836d84bc0d3f705c3f9751f34 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Sun, 4 Oct 2026 17:14:06 -0700 Subject: [PATCH 2/6] 2026-10-04 api sync --- CHANGELOG.md | 25 + README.md | 71 +- openapi/seclai.openapi.json | 19770 ++++++++++------ seclai/__init__.py | 4 + ...gents_agent_id_evaluation_criteria_post.py | 32 +- ...ation_criteria_criteria_id_results_post.py | 26 +- ..._evaluation_criteria_criteria_id_delete.py | 26 +- ...nts_evaluation_criteria_criteria_id_get.py | 32 +- ...uation_criteria_criteria_id_summary_get.py | 47 +- ...aluation_results_non_manual_summary_get.py | 47 +- ..._agents_agent_id_evaluation_results_get.py | 53 +- ...riteria_criteria_id_compatible_runs_get.py | 32 +- ...agents_agent_id_evaluation_criteria_get.py | 47 +- ...uation_criteria_criteria_id_results_get.py | 38 +- ...api_agents_agent_id_evaluation_runs_get.py | 47 +- ...t_id_runs_run_id_evaluation_results_get.py | 53 +- ..._id_evaluation_criteria_test_draft_post.py | 48 +- ...s_evaluation_criteria_criteria_id_patch.py | 32 +- ...ns_run_id_attachments_attachment_id_get.py | 58 +- ...ents_agent_id_attachment_references_get.py | 47 +- ...ts_agent_id_input_uploads_upload_id_get.py | 32 +- ...t_api_agents_agent_id_upload_input_post.py | 32 +- ...i_api_agents_blocked_email_senders_post.py | 32 +- ...inbound_email_status_cancel_queued_post.py | 42 +- .../agents/create_agent_api_agents_post.py | 59 +- ...delete_agent_api_agents_agent_id_delete.py | 26 +- ...agent_run_api_agents_runs_run_id_delete.py | 34 +- ...nt_api_api_agents_agent_id_disable_post.py | 26 +- ...ent_api_api_agents_agent_id_enable_post.py | 26 +- ...rt_agent_api_agents_agent_id_export_get.py | 34 +- ...ent_id_ai_assistant_generate_steps_post.py | 32 +- ..._agent_id_ai_assistant_step_config_post.py | 32 +- ...ers_api_api_agents_agent_id_callers_get.py | 38 +- ...tion_api_agents_agent_id_definition_get.py | 54 +- ..._agent_metadata_api_agents_agent_id_get.py | 26 +- ...et_agent_run_api_agents_runs_run_id_get.py | 26 +- ...agent_id_ai_assistant_conversations_get.py | 38 +- ...api_api_agents_inbound_email_status_get.py | 26 +- ..._api_api_agents_agent_email_optouts_get.py | 38 +- ...agent_runs_api_agents_agent_id_runs_get.py | 26 +- .../api/agents/list_agents_api_agents_get.py | 26 +- ...pi_api_agents_blocked_email_senders_get.py | 47 +- ...api_agents_inbound_email_rejections_get.py | 47 +- ...t_id_ai_assistant_conversation_id_patch.py | 26 +- ...rt_agent_api_agents_preview_import_post.py | 77 +- ...ts_agent_email_optouts_optout_id_delete.py | 26 +- ...agents_inbound_email_status_resume_post.py | 26 +- ...run_agent_api_agents_agent_id_runs_post.py | 83 +- ...nt_api_agents_agent_id_runs_stream_post.py | 94 +- ..._agent_runs_api_agents_runs_search_post.py | 26 +- ...i_agents_blocked_email_senders_mode_put.py | 47 +- ...id_triggers_trigger_id_email_config_put.py | 32 +- ...blocked_email_senders_blocked_id_delete.py | 26 +- .../update_agent_api_agents_agent_id_put.py | 47 +- ...tion_api_agents_agent_id_definition_put.py | 26 +- ...i_assistant_conversation_id_accept_post.py | 32 +- ..._assistant_conversation_id_decline_post.py | 26 +- ...feedback_api_ai_assistant_feedback_post.py | 32 +- ...se_api_ai_assistant_knowledge_base_post.py | 32 +- ...stant_memory_bank_conversation_id_patch.py | 26 +- ..._bank_api_ai_assistant_memory_bank_post.py | 38 +- ...stant_memory_bank_last_conversation_get.py | 47 +- ...solution_api_ai_assistant_solution_post.py | 32 +- ..._ai_source_api_ai_assistant_source_post.py | 32 +- ...mment_api_alerts_alert_id_comments_post.py | 26 +- ..._status_api_alerts_alert_id_status_post.py | 26 +- ...te_alert_config_api_alerts_configs_post.py | 26 +- ...fig_api_alerts_configs_config_id_delete.py | 26 +- ...config_api_alerts_configs_config_id_get.py | 26 +- ...et_alert_detail_api_alerts_alert_id_get.py | 26 +- ...st_alert_configs_api_alerts_configs_get.py | 26 +- .../api/alerts/list_alerts_api_alerts_get.py | 26 +- ...lerts_organization_preferences_list_get.py | 53 +- ...lert_api_alerts_alert_id_subscribe_post.py | 38 +- ...rt_api_alerts_alert_id_unsubscribe_post.py | 26 +- ...nfig_api_alerts_configs_config_id_patch.py | 26 +- ...rences_organization_id_alert_type_patch.py | 47 +- .../_generated/api/cloud_drives/__init__.py | 1 + ...i_api_cloud_drives_connection_id_delete.py | 230 + ...ud_drives_connection_id_disconnect_post.py | 222 + ...i_cloud_drives_connection_id_agents_get.py | 258 + ..._api_api_cloud_drives_connection_id_get.py | 218 + ...ders_api_api_cloud_drives_providers_get.py | 213 + ...oud_drives_connection_id_rejections_get.py | 294 + ...t_cloud_drives_api_api_cloud_drives_get.py | 211 + ...pi_api_cloud_drives_connection_id_patch.py | 240 + ...ource_connection_content_version_delete.py | 38 +- ...s_source_connection_content_version_get.py | 26 +- ...nnection_content_version_embeddings_get.py | 38 +- ...s_source_connection_content_version_put.py | 52 +- ..._connection_content_version_upload_post.py | 64 +- ...email_domain_api_api_email_domains_post.py | 26 +- ...i_api_email_domains_domain_id_dmarc_get.py | 26 +- ...email_domains_api_api_email_domains_get.py | 26 +- ..._api_api_email_domains_domain_id_delete.py | 32 +- ...email_domains_domain_id_test_email_post.py | 26 +- ...pi_email_domains_domain_id_primary_post.py | 62 +- ...pi_email_domains_use_shared_domain_post.py | 105 +- ...api_email_domains_domain_id_verify_post.py | 26 +- ...i_assistant_conversation_id_accept_post.py | 50 +- ..._assistant_conversation_id_decline_post.py | 26 +- ...nerate_api_governance_ai_assistant_post.py | 50 +- ...vernance_ai_assistant_conversations_get.py | 59 +- .../api/identity/get_me_api_me_get.py | 26 +- ...knowledge_base_api_knowledge_bases_post.py | 26 +- ...nowledge_bases_knowledge_base_id_delete.py | 26 +- ...i_knowledge_bases_knowledge_base_id_get.py | 26 +- ...knowledge_bases_api_knowledge_bases_get.py | 47 +- ...i_knowledge_bases_knowledge_base_id_put.py | 26 +- ...emory_banks_memory_bank_id_compact_post.py | 52 +- ...reate_memory_bank_api_memory_banks_post.py | 26 +- ..._api_memory_banks_memory_bank_id_delete.py | 26 +- ...mory_banks_memory_bank_id_source_delete.py | 26 +- ..._memory_banks_memory_bank_id_agents_get.py | 26 +- ...ank_api_memory_banks_memory_bank_id_get.py | 26 +- ...i_memory_banks_memory_bank_id_stats_get.py | 20 +- .../list_memory_banks_api_memory_banks_get.py | 32 +- ...emplates_api_memory_banks_templates_get.py | 87 +- ...anks_ai_assistant_conversation_id_patch.py | 26 +- ...rate_api_memory_banks_ai_assistant_post.py | 50 +- ...anks_ai_assistant_last_conversation_get.py | 47 +- ...nks_memory_bank_id_test_compaction_post.py | 32 +- ...e_api_memory_banks_test_compaction_post.py | 32 +- ...ank_api_memory_banks_memory_bank_id_put.py | 26 +- ...d_experiments_experiment_id_cancel_post.py | 34 +- ..._api_models_playground_experiments_post.py | 34 +- ...ground_experiments_experiment_id_delete.py | 34 +- ...ount_api_models_alerts_unread_count_get.py | 26 +- ...layground_experiments_experiment_id_get.py | 34 +- ...n_tiers_api_models_generation_tiers_get.py | 26 +- ...t_model_api_models_model_id_details_get.py | 26 +- ...api_models_model_id_recommendations_get.py | 38 +- .../list_alerts_api_models_alerts_get.py | 26 +- ...bedding_models_api_models_embedders_get.py | 313 + ...s_api_models_playground_experiments_get.py | 38 +- .../api/models/list_models_api_models_get.py | 56 +- ...eranker_models_api_models_rerankers_get.py | 236 + ...ad_api_models_alerts_mark_all_read_post.py | 89 +- ...d_api_models_alerts_alert_id_read_patch.py | 26 +- .../search/docs_search_api_docs_search_get.py | 26 +- .../api/search/search_api_search_get.py | 26 +- ...olutions_solution_id_conversations_post.py | 38 +- ...i_assistant_conversation_id_accept_post.py | 32 +- ..._assistant_conversation_id_decline_post.py | 26 +- ..._solution_id_ai_assistant_generate_post.py | 32 +- ...ion_id_ai_assistant_knowledge_base_post.py | 32 +- ...ns_solution_id_ai_assistant_source_post.py | 32 +- .../create_solution_api_solutions_post.py | 26 +- ...lution_api_solutions_solution_id_delete.py | 26 +- ..._solution_api_solutions_solution_id_get.py | 26 +- ...s_api_solutions_solution_id_agents_post.py | 26 +- ...utions_solution_id_knowledge_bases_post.py | 26 +- ...ons_solution_id_source_connections_post.py | 26 +- ...solutions_solution_id_conversations_get.py | 47 +- .../list_solutions_api_solutions_get.py | 26 +- ..._id_conversations_conversation_id_patch.py | 26 +- ...api_solutions_solution_id_agents_delete.py | 26 +- ...ions_solution_id_knowledge_bases_delete.py | 26 +- ...s_solution_id_source_connections_delete.py | 26 +- ...olution_api_solutions_solution_id_patch.py | 26 +- ...ection_id_exports_export_id_cancel_post.py | 48 +- ...urces_source_connection_id_exports_post.py | 48 +- ..._connection_id_exports_export_id_delete.py | 46 +- ...ction_id_exports_export_id_download_get.py | 26 +- ...rce_connection_id_exports_estimate_post.py | 26 +- ...rce_connection_id_exports_export_id_get.py | 26 +- ...ources_source_connection_id_exports_get.py | 26 +- ...tion_id_embedding_migration_cancel_post.py | 63 +- .../sources/create_source_api_sources_post.py | 26 +- ...api_sources_source_connection_id_delete.py | 26 +- ...ce_api_sources_source_connection_id_get.py | 26 +- ...tion_id_contents_content_version_id_get.py | 266 + ...e_connection_id_embedding_migration_get.py | 59 +- ...urces_source_connection_id_contents_get.py | 452 + .../sources/list_sources_api_sources_get.py | 26 +- ..._connection_id_embedding_migration_post.py | 59 +- ...ce_api_sources_source_connection_id_put.py | 26 +- ...ources_source_connection_id_upload_post.py | 104 +- ...e_api_sources_source_connection_id_post.py | 92 +- .../get_api_version_api_version_get.py | 26 +- .../update_api_version_api_version_put.py | 26 +- seclai/_generated/models/__init__.py | 48 + .../models/agent_export_response.py | 2 +- .../models/agent_run_file_response.py | 109 + seclai/_generated/models/agent_run_request.py | 9 +- .../_generated/models/agent_run_response.py | 75 +- .../models/agent_run_step_response.py | 66 +- .../models/agent_run_stream_request.py | 9 +- .../models/agent_run_tool_call_response.py | 3 +- .../agent_using_cloud_drive_response_model.py | 93 + .../models/ai_assistant_feedback_request.py | 32 + ...cloud_drive_access_level_response_model.py | 85 + .../cloud_drive_provider_response_model.py | 119 + .../cloud_drive_rejection_response_model.py | 140 + .../models/cloud_drive_response_model.py | 298 + .../cloud_drive_scope_response_model.py | 85 + .../models/cloud_drive_update_request.py | 96 + .../models/content_detail_response.py | 64 + .../models/content_embedding_response.py | 82 + .../models/create_alert_config_request.py | 20 +- .../models/create_knowledge_base_body.py | 14 +- .../models/create_memory_bank_body.py | 30 +- .../_generated/models/create_source_body.py | 9 +- .../models/effort_options_response.py | 95 + .../embedding_modality_rate_response.py | 85 + .../models/embedding_model_list_response.py | 152 + .../models/embedding_model_response.py | 340 + .../embedding_storage_credits_response.py | 70 + .../models/experiment_detail_response.py | 24 + .../experiment_detail_response_effort.py | 46 + .../_generated/models/file_upload_response.py | 32 +- seclai/_generated/models/knowledge_base.py | 6 +- seclai/_generated/models/memory_bank.py | 19 +- .../models/memory_bank_config_response.py | 3 +- .../models/model_recommendation_response.py | 40 +- .../models/playground_create_request.py | 49 +- ...playground_create_request_effort_type_0.py | 46 + .../models/prompt_model_response.py | 160 +- ...e_generation_credits_per_variant_type_0.py | 48 + .../models/reranker_model_list_response.py | 92 + .../models/reranker_model_response.py | 211 + .../models/service_unavailable_error.py | 69 + .../models/service_unavailable_error_error.py | 73 + .../service_unavailable_error_error_code.py | 9 + .../set_email_trigger_config_request.py | 7 +- .../source_content_status_list_response.py | 86 + .../models/source_content_status_response.py | 301 + ...tart_source_embedding_migration_request.py | 3 +- .../models/update_knowledge_base_body.py | 12 +- .../models/update_memory_bank_body.py | 32 +- .../_generated/models/update_source_body.py | 11 +- .../models/variant_option_response.py | 43 +- seclai/seclai.py | 742 +- seclai/versions.py | 19 +- tests/test_new_methods.py | 544 +- 235 files changed, 24801 insertions(+), 9213 deletions(-) create mode 100644 seclai/_generated/api/cloud_drives/__init__.py create mode 100644 seclai/_generated/api/cloud_drives/delete_cloud_drive_api_api_cloud_drives_connection_id_delete.py create mode 100644 seclai/_generated/api/cloud_drives/disconnect_cloud_drive_api_api_cloud_drives_connection_id_disconnect_post.py create mode 100644 seclai/_generated/api/cloud_drives/get_agents_using_cloud_drive_api_api_cloud_drives_connection_id_agents_get.py create mode 100644 seclai/_generated/api/cloud_drives/get_cloud_drive_api_api_cloud_drives_connection_id_get.py create mode 100644 seclai/_generated/api/cloud_drives/list_cloud_drive_providers_api_api_cloud_drives_providers_get.py create mode 100644 seclai/_generated/api/cloud_drives/list_cloud_drive_rejections_api_api_cloud_drives_connection_id_rejections_get.py create mode 100644 seclai/_generated/api/cloud_drives/list_cloud_drives_api_api_cloud_drives_get.py create mode 100644 seclai/_generated/api/cloud_drives/update_cloud_drive_api_api_cloud_drives_connection_id_patch.py create mode 100644 seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py create mode 100644 seclai/_generated/api/models/list_reranker_models_api_models_rerankers_get.py create mode 100644 seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py create mode 100644 seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py create mode 100644 seclai/_generated/models/agent_run_file_response.py create mode 100644 seclai/_generated/models/agent_using_cloud_drive_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_access_level_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_provider_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_rejection_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_scope_response_model.py create mode 100644 seclai/_generated/models/cloud_drive_update_request.py create mode 100644 seclai/_generated/models/effort_options_response.py create mode 100644 seclai/_generated/models/embedding_modality_rate_response.py create mode 100644 seclai/_generated/models/embedding_model_list_response.py create mode 100644 seclai/_generated/models/embedding_model_response.py create mode 100644 seclai/_generated/models/embedding_storage_credits_response.py create mode 100644 seclai/_generated/models/experiment_detail_response_effort.py create mode 100644 seclai/_generated/models/playground_create_request_effort_type_0.py create mode 100644 seclai/_generated/models/prompt_model_response_generation_credits_per_variant_type_0.py create mode 100644 seclai/_generated/models/reranker_model_list_response.py create mode 100644 seclai/_generated/models/reranker_model_response.py create mode 100644 seclai/_generated/models/service_unavailable_error.py create mode 100644 seclai/_generated/models/service_unavailable_error_error.py create mode 100644 seclai/_generated/models/service_unavailable_error_error_code.py create mode 100644 seclai/_generated/models/source_content_status_list_response.py create mode 100644 seclai/_generated/models/source_content_status_response.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f35672..a3db491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [1.6.0] - 2026-10-04 + +### Changed + +- Sync the bundled OpenAPI spec, adding 10 paths and 18 schemas. The typed models gain the new response fields, including `attachments` on a run and on each step +- Move `LATEST_API_VERSION` to `2026-10-03` + +### Added + +- Add `list_cloud_drives()`, `get_cloud_drive()`, `update_cloud_drive()`, `disconnect_cloud_drive()`, `delete_cloud_drive()`, `list_cloud_drive_providers()`, `get_agents_using_cloud_drive()` and `list_cloud_drive_rejections()` for cloud-drive connections. The list methods return the items on either response shape +- Add `list_source_contents()` and `get_source_content_status()` to read the indexing status of a source's content, keyed by the `content_version_id` the upload methods return +- Add `list_embedding_models()` and `list_reranker_models()`, with the pricing and defaults that sit beside each list +- Add `ApiVersion` members for `2026-08-03`, `2026-08-21`, `2026-09-28`, `2026-09-30` and `2026-10-03`, so each can be selected without `allow_unknown_api_version` +- Add a `param_style` argument to `paginate()` for endpoints that page by `offset` rather than `page` + +### Fixed + +- Read the body of an error response in the streaming methods. A 422 from `run_streaming_agent_and_wait()` escaped as `httpx.ResponseNotRead`, a 422 from `run_streaming_agent()` lost its field-level detail, and every streaming error had an empty `response_text` +- Raise `SeclaiAPIStatusError` on a 422 whose `detail` is a plain string. Decoding it as field-level validation raised `ValueError` from inside the generated models +- Replace a header case-insensitively when a per-request `headers` argument or the auth layer supplies one the client already set. Both spellings were sent +- Yield the items from `paginate()` when the endpoint answers with a bare array. It yielded nothing +- Copy `default_headers` at construction. Mutating the mapping afterwards put an unvalidated `Seclai-Version` on the wire +- Reject an empty `Seclai-Version` in `default_headers`. It was read as absent, sent anyway, and suppressed `api_version` + ## [1.5.0] - 2026-07-27 ### Changed @@ -158,6 +182,7 @@ _Stable release. Packaging, CI, and documentation deployment only; no API change _Initial release._ +[1.6.0]: https://github.com/seclai/seclai-python/releases/tag/1.6.0 [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 diff --git a/README.md b/README.md index 53c0051..f225e60 100644 --- a/README.md +++ b/README.md @@ -184,8 +184,6 @@ 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 | @@ -210,8 +208,25 @@ 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. +them only terminates once you have opted in. `get_generation_tiers()` takes no +paging arguments at all and always returns the full set. The remaining three +paginate on either shape. + +**Later versions.** Each is cumulative, and none changes a response shape this +client decodes: + +| Version | What it changes | +| --- | --- | +| `2026-08-03` | `create_memory_bank()` and `update_memory_bank()` reject a non-zero `max_age_days` with a 400, and an omitted `retention_days` on create resolves per bank type | +| `2026-08-21` | `create_source()` rejects an embedding dimension its embedder does not support with a 400 — `list_embedding_models()` reports the supported ones | +| `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 | + +The cloud-drive listings and `list_embedding_models()` / `list_reranker_models()` +follow the `2026-07-27` envelope rule as well. The cloud-drive methods return +the items on either shape; read the two model listings with +`unwrap_items(result, "models")`. ## Resources @@ -282,9 +297,9 @@ 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 +# Cancel an in-flight or queued run. `delete_agent_run()` is the same +# operation on the same endpoint, returning a typed model instead of a dict. client.cancel_agent_run("run_id") -client.delete_agent_run("run_id") ``` ### Streaming @@ -366,8 +381,8 @@ with response: 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") +# Conversation history — step_type is required by the API +history = client.get_agent_ai_conversation_history("agent_id", step_type="llm") client.mark_agent_ai_suggestion("agent_id", "conversation_id", {"accepted": True}) ``` @@ -448,6 +463,33 @@ client.update_source("source_id", {"name": "Updated"}) client.delete_source("source_id") ``` +Indexing status of a source's content, keyed by the `content_version_id` the +upload methods return: + +```python +failed = client.list_source_contents("source_id", status="failed") +batch = client.list_source_contents( + "source_id", content_version_ids=["cv_1", "cv_2"] +) +one = client.get_source_content_status("source_id", "cv_1") +``` + +### Cloud drives + +```python +providers = client.list_cloud_drive_providers() +drives = client.list_cloud_drives() +drive = client.get_cloud_drive("connection_id") +client.update_cloud_drive("connection_id", {"name": "Contracts"}) + +# Which agents depend on it, and which files it skipped and why +agents = client.get_agents_using_cloud_drive("connection_id") +skipped = client.list_cloud_drive_rejections("connection_id", limit=20) + +client.disconnect_cloud_drive("connection_id") # keeps the connection +client.delete_cloud_drive("connection_id") +``` + ### File uploads Upload a file to a source (max 200 MiB): @@ -657,6 +699,10 @@ print(removed.get("cleanup_note")) # set when the domain was Seclai-managed # Media-generation quality tiers (fast/balanced/thorough) and what each resolves to tiers = client.get_generation_tiers() +# Embedding and reranker models, with their pricing +embedders = unwrap_items(client.list_embedding_models(), "models") +rerankers = unwrap_items(client.list_reranker_models(), "models") + alerts = client.list_model_alerts() client.mark_model_alert_read("alert_id") client.mark_all_model_alerts_read() @@ -719,8 +765,13 @@ All list methods accept `page` and `limit` parameters. For auto-pagination acros 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"): +# With a custom items key, for an endpoint still on a per-resource key +for config in client.paginate("GET", "/alerts/configs", items_key="configs"): + print(config["id"]) + +# Endpoints that declare `offset` rather than `page` +for alert in client.paginate("GET", "/models/alerts", items_key="alerts", + param_style="offset"): print(alert["id"]) ``` diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index c497763..3d86fdc 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -373,7 +373,7 @@ "title": "Evaluation Criteria" }, "export_version": { - "description": "Schema version of the export format (currently \"2\").", + "description": "Schema version of the export format (currently \"5\").", "title": "Export Version", "type": "string" }, @@ -491,6 +491,60 @@ "title": "AgentRunAttemptResponse", "type": "object" }, + "AgentRunFileResponse": { + "description": "A file in a run's or a step's output.", + "properties": { + "bytes": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Size of the file in bytes, when known.", + "title": "Bytes" + }, + "download_url": { + "description": "`GET` URL that streams the file; accepts an API key or OAuth token.", + "title": "Download Url", + "type": "string" + }, + "id": { + "description": "File identifier, used to download it.", + "format": "uuid", + "title": "Id", + "type": "string" + }, + "mime": { + "description": "MIME type of the file.", + "title": "Mime", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The file's name in this run, as sent to email recipients and webhooks and matched by `{{attachments[...]}}` selectors.", + "title": "Name" + } + }, + "required": [ + "id", + "name", + "mime", + "bytes", + "download_url" + ], + "title": "AgentRunFileResponse", + "type": "object" + }, "AgentRunRequest": { "properties": { "input": { @@ -515,7 +569,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 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.", + "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.", "title": "Input Upload Id" }, "input_upload_ids": { @@ -532,7 +586,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`` and ``input_upload_id`` \u2014 pass exactly one of the three. Max 20 uploads per run.", + "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.", "title": "Input Upload Ids" }, "metadata": { @@ -575,6 +629,14 @@ }, "AgentRunResponse": { "properties": { + "attachments": { + "description": "Files in the run's output, in order. Empty for runs that produced none, for runs made before files were listed here, and once the run's trace is purged.", + "items": { + "$ref": "#/components/schemas/AgentRunFileResponse" + }, + "title": "Attachments", + "type": "array" + }, "attempts": { "description": "List of attempts made for this agent run.", "items": { @@ -600,7 +662,7 @@ "type": "null" } ], - "description": "Credits consumed by the agent run, if applicable.", + "description": "Credits consumed by the agent run, if applicable. Can still rise briefly after the run ends, while governance screening finishes.", "title": "Credits" }, "error_count": { @@ -685,7 +747,7 @@ "type": "null" } ], - "description": "Output produced by the agent run.", + "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.", "title": "Output" }, "output_content_type": { @@ -697,7 +759,7 @@ "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.", + "description": "MIME type of `output` \u2014 mirrors the terminal step's `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see `output`); the same files are in `attachments` on every version, each with a `download_url`. Null on runs that produced no terminal output or that pre-date this column.", "title": "Output Content Type" }, "priority": { @@ -741,6 +803,19 @@ "description": "Step outputs and per-step timing/credits. Only included when requested.", "title": "Steps" }, + "trace_purged_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "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.", + "title": "Trace Purged At" + }, "wait_ms": { "anyOf": [ { @@ -774,8 +849,16 @@ "title": "Agent Step Id", "type": "string" }, + "attachments": { + "description": "Files in this step's output, in order. Empty for steps that produced none, for steps run before files were listed here, and once the run's trace is purged.", + "items": { + "$ref": "#/components/schemas/AgentRunFileResponse" + }, + "title": "Attachments", + "type": "array" + }, "credits_used": { - "description": "Credits consumed by the step attempt, if applicable.", + "description": "Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only.", "title": "Credits Used", "type": "number" }, @@ -812,7 +895,7 @@ "type": "null" } ], - "description": "Input provided to the step, if any.", + "description": "Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step that produced it output files and is not a `for_each`.", "title": "Input" }, "output": { @@ -824,7 +907,7 @@ "type": "null" } ], - "description": "Output produced by the step, if any.", + "description": "Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`.", "title": "Output" }, "output_content_type": { @@ -867,6 +950,21 @@ }, "title": "Tool Calls", "type": "array" + }, + "warnings": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "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.", + "title": "Warnings" } }, "required": [ @@ -908,7 +1006,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 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.", + "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.", "title": "Input Upload Id" }, "input_upload_ids": { @@ -925,7 +1023,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). Max 20.", + "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.", "title": "Input Upload Ids" }, "metadata": { @@ -1047,7 +1145,7 @@ }, "sequence": { "default": 0, - "description": "0-based ordinal of this call within its step run.", + "description": "0-based ordinal of this call within one attempt of the step, so it repeats across a retried step's attempts. This list holds the latest attempt only.", "title": "Sequence", "type": "integer" }, @@ -1383,6 +1481,47 @@ "title": "AgentTraceSearchResponse", "type": "object" }, + "AgentUsingCloudDriveResponseModel": { + "properties": { + "agent_id": { + "description": "Agent identifier.", + "title": "Agent Id", + "type": "string" + }, + "agent_name": { + "description": "Agent name.", + "title": "Agent Name", + "type": "string" + }, + "trigger_types": { + "description": "File-change trigger types bound to this drive.", + "items": { + "type": "string" + }, + "title": "Trigger Types", + "type": "array" + }, + "via_prompt_tool": { + "description": "Uses a prompt_call cloud-drive tool.", + "title": "Via Prompt Tool", + "type": "boolean" + }, + "via_step": { + "description": "Uses a list/read/write cloud-drive step.", + "title": "Via Step", + "type": "boolean" + } + }, + "required": [ + "agent_id", + "agent_name", + "via_step", + "via_prompt_tool", + "trigger_types" + ], + "title": "AgentUsingCloudDriveResponseModel", + "type": "object" + }, "AiAssistantAcceptResponse": { "description": "Response from accepting and executing a plan.", "properties": { @@ -2210,149 +2349,85 @@ "title": "ChangeStatusRequest", "type": "object" }, - "CompactionEvaluationModel": { - "description": "Structured LLM-as-judge evaluation result.", + "CloudDriveAccessLevelResponseModel": { "properties": { - "reasoning": { - "description": "Explanation of the evaluation.", - "title": "Reasoning", - "type": "string" - }, - "score": { - "description": "Quality score from 1 to 5.", - "title": "Score", - "type": "integer" + "default": { + "description": "Whether connecting without a choice uses it.", + "title": "Default", + "type": "boolean" }, - "verdict": { - "description": "'pass' or 'fail'.", - "title": "Verdict", + "description": { + "description": "What agents can do at this level.", + "title": "Description", "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", + }, + "key": { + "description": "Level identifier, e.g. `read_write`/`read_only`.", + "title": "Key", "type": "string" }, - "status": { - "title": "Status", + "label": { + "description": "Short human-readable name.", + "title": "Label", "type": "string" } }, "required": [ - "memory_bank_id", - "status" + "key", + "label", + "description", + "default" ], - "title": "CompactionScheduledResponse", + "title": "CloudDriveAccessLevelResponseModel", "type": "object" }, - "CompactionTestResponseModel": { - "description": "Response from a compaction prompt test.", + "CloudDriveProviderResponseModel": { "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.", + "access_levels": { + "description": "Mutually-exclusive permission bundles offered when connecting. Connecting happens in the app, so this is informational here \u2014 it explains what a connection's `access_level` can be.", "items": { - "type": "string" + "$ref": "#/components/schemas/CloudDriveAccessLevelResponseModel" }, - "title": "Original Entries", + "title": "Access Levels", "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": { + "display_name": { + "description": "Human-readable provider name.", + "title": "Display Name", + "type": "string" + }, + "key": { + "description": "Provider key used as `provider` on a connection.", + "title": "Key", + "type": "string" + }, + "scopes": { + "description": "OAuth permissions this provider can request.", "items": { - "$ref": "#/components/schemas/CompatibleRunResponse" + "$ref": "#/components/schemas/CloudDriveScopeResponseModel" }, - "title": "Data", + "title": "Scopes", "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" } }, "required": [ - "data", - "total", - "page", - "limit" + "key", + "display_name", + "scopes", + "access_levels" ], - "title": "CompatibleRunListResponse", + "title": "CloudDriveProviderResponseModel", "type": "object" }, - "CompatibleRunResponse": { - "description": "A run that has a completed step matching a criteria's step_id.", + "CloudDriveRejectionResponseModel": { + "description": "One file the connection deliberately did not process.", "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "format": "uuid", - "title": "Agent Step Run Id", + "created_at": { + "description": "When the file was skipped.", + "title": "Created At", "type": "string" }, - "completed_at": { + "detail": { "anyOf": [ { "type": "string" @@ -2361,9 +2436,10 @@ "type": "null" } ], - "title": "Completed At" + "description": "Extra context, e.g. the cap that was hit.", + "title": "Detail" }, - "input_preview": { + "file_id": { "anyOf": [ { "type": "string" @@ -2372,9 +2448,10 @@ "type": "null" } ], - "title": "Input Preview" + "description": "The provider's file id, when the file was known.", + "title": "File Id" }, - "output_storage_key": { + "file_path": { "anyOf": [ { "type": "string" @@ -2383,9 +2460,32 @@ "type": "null" } ], - "title": "Output Storage Key" + "description": "Path of the skipped file, when known.", + "title": "File Path" }, - "run_status": { + "id": { + "description": "Rejection identifier.", + "title": "Id", + "type": "string" + }, + "reason": { + "description": "`too_large`, `download_failed`, or `flood`.", + "title": "Reason", + "type": "string" + } + }, + "required": [ + "id", + "reason", + "created_at" + ], + "title": "CloudDriveRejectionResponseModel", + "type": "object" + }, + "CloudDriveResponseModel": { + "description": "A cloud-drive connection, without any secret material.", + "properties": { + "access_level": { "anyOf": [ { "type": "string" @@ -2394,10 +2494,21 @@ "type": "null" } ], - "title": "Run Status" + "description": "The permission bundle the granted scopes correspond to \u2014 `read_write` or `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather than assuming write access.", + "title": "Access Level" }, - "started_at": { - "anyOf": [ + "connected": { + "description": "True when the connection is usable.", + "title": "Connected", + "type": "boolean" + }, + "created_at": { + "description": "When the connection was created.", + "title": "Created At", + "type": "string" + }, + "drive_id": { + "anyOf": [ { "type": "string" }, @@ -2405,68 +2516,10 @@ "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" + "description": "Opaque id of the shared drive the folder resolves to, or null for the user's own drive. Stable across renames \u2014 compare on this rather than on the name in `folder_path`.", + "title": "Drive Id" }, - "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": { + "drive_name": { "anyOf": [ { "type": "string" @@ -2475,48 +2528,37 @@ "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" + "description": "Display name the shared drive last resolved to. Presentation only; never match on it.", + "title": "Drive Name" }, - "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", + "drive_name_stale": { + "description": "True when `drive_name` could not be re-confirmed (the drive was deleted, access was lost, or the provider was unreachable). The last known name is still reported \u2014 treat it as possibly out of date rather than current.", + "title": "Drive Name Stale", "type": "boolean" }, - "recipient_user_ids": { + "external_account_id": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" + "description": "The provider's own opaque account identifier (never an email).", + "title": "External Account Id" }, - "source_connection_id": { + "folder_path": { + "description": "Watched folder; empty string means the drive root. A folder on a shared drive is written `/Shared drives//`.", + "title": "Folder Path", + "type": "string" + }, + "id": { + "description": "Connection identifier.", + "title": "Id", + "type": "string" + }, + "last_error": { "anyOf": [ { "type": "string" @@ -2525,33 +2567,22 @@ "type": "null" } ], - "description": "Source connection ID (for source alerts)", - "title": "Source Connection Id" + "description": "Most recent sync or authorization error, if any.", + "title": "Last Error" }, - "threshold": { + "last_synced_at": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "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": { + "description": "When the connection last synced successfully.", + "title": "Last Synced At" + }, + "name": { "anyOf": [ { "type": "string" @@ -2560,14 +2591,10 @@ "type": "null" } ], - "title": "Description" - }, - "enabled": { - "default": true, - "title": "Enabled", - "type": "boolean" + "description": "Human-readable name.", + "title": "Name" }, - "evaluation_prompt": { + "oauth_scopes": { "anyOf": [ { "type": "string" @@ -2576,126 +2603,138 @@ "type": "null" } ], - "title": "Evaluation Prompt" + "description": "Space-separated OAuth scopes granted to this connection.", + "title": "Oauth Scopes" }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] + "provider": { + "description": "Provider key, e.g. `dropbox` or `google_drive`.", + "title": "Provider", + "type": "string" }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" + "realtime_updates": { + "description": "True when changes arrive via the provider's push notifications. False means the drive still syncs, but only on the scheduled backstop sweep rather than within seconds of a change.", + "title": "Realtime Updates", + "type": "boolean" }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" + "status": { + "description": "One of `active`, `pending_auth`, `error`, `disconnected`.", + "title": "Status", + "type": "string" }, - "step_id": { - "maxLength": 255, - "minLength": 1, - "title": "Step Id", + "updated_at": { + "description": "When the connection was last modified.", + "title": "Updated At", "type": "string" } }, "required": [ - "step_id" + "id", + "provider", + "status", + "folder_path", + "drive_name_stale", + "connected", + "realtime_updates", + "created_at", + "updated_at" ], - "title": "CreateEvaluationCriteriaRequest", + "title": "CloudDriveResponseModel", "type": "object" }, - "CreateEvaluationResultRequest": { - "description": "Request body for recording an evaluation result.", + "CloudDriveScopeResponseModel": { "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", + "description": { + "description": "What the scope allows.", + "title": "Description", "type": "string" }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" + "key": { + "description": "The OAuth scope string sent to the provider.", + "title": "Key", + "type": "string" }, - "details": { + "label": { + "description": "Short human-readable name.", + "title": "Label", + "type": "string" + }, + "recommended": { + "description": "Whether this scope is requested by default on connect.", + "title": "Recommended", + "type": "boolean" + } + }, + "required": [ + "key", + "label", + "description", + "recommended" + ], + "title": "CloudDriveScopeResponseModel", + "type": "object" + }, + "CloudDriveUpdateRequest": { + "properties": { + "folder_path": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Details" - }, - "flagged": { - "default": false, - "title": "Flagged", - "type": "boolean" - }, - "retry_count": { - "default": 0, - "minimum": 0.0, - "title": "Retry Count", - "type": "integer" + "description": "New watched folder; empty means the whole drive. A folder on a shared drive is written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new folder are NOT replayed as triggers \u2014 only subsequent changes fire, matching connect-time behaviour. Rejected when the new folder would make an agent that writes there re-trigger itself.", + "title": "Folder Path" }, - "retry_triggered": { - "default": false, - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { + "name": { "anyOf": [ { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Score" - }, - "status": { - "$ref": "#/components/schemas/EvaluationStatus" + "description": "New display name for the connection.", + "title": "Name" } }, - "required": [ - "agent_run_id", - "status" - ], - "title": "CreateEvaluationResultRequest", + "title": "CloudDriveUpdateRequest", "type": "object" }, - "CreateExperimentResponse": { + "CompactionEvaluationModel": { + "description": "Structured LLM-as-judge evaluation result.", "properties": { - "experiment_id": { - "title": "Experiment Id", + "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": { @@ -2704,136 +2743,131 @@ } }, "required": [ - "experiment_id", + "memory_bank_id", "status" ], - "title": "CreateExperimentResponse", + "title": "CompactionScheduledResponse", "type": "object" }, - "CreateKnowledgeBaseBody": { - "description": "Request body for creating a knowledge base.", + "CompactionTestResponseModel": { + "description": "Response from a compaction prompt test.", "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": { + "compaction_summary": { "anyOf": [ { - "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "description": "Optional description.", - "title": "Description" + "description": "The generated compaction summary.", + "title": "Compaction Summary" }, - "name": { - "description": "Knowledge base name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" + "evaluation": { + "$ref": "#/components/schemas/CompactionEvaluationModel", + "description": "LLM-as-judge quality evaluation." }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model to use (null for no reranking).", - "title": "Reranker Model" + "generated": { + "description": "True when entries were LLM-generated rather than real.", + "title": "Generated", + "type": "boolean" }, - "source_ids": { - "description": "List of source connection IDs to link.", + "original_entries": { + "description": "Entries fed into the compactor.", "items": { "type": "string" }, - "minItems": 1, - "title": "Source Ids", + "title": "Original Entries", + "type": "array" + }, + "surviving_entries": { + "description": "Entries that survived after compaction.", + "items": { + "type": "string" + }, + "title": "Surviving Entries", "type": "array" } }, "required": [ - "name", - "source_ids" + "original_entries", + "compaction_summary", + "surviving_entries", + "evaluation", + "generated" ], - "title": "CreateKnowledgeBaseBody", + "title": "CompactionTestResponseModel", "type": "object" }, - "CreateMemoryBankBody": { - "description": "Request body for creating a memory bank.", + "CompatibleRunListResponse": { + "description": "Paginated list of compatible runs.", "properties": { - "chunk_overlap": { + "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": [ { - "minimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Chunk overlap (custom mode only).", - "title": "Chunk Overlap" + "title": "Completed At" }, - "chunk_size": { + "input_preview": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Chunk size (custom mode only).", - "title": "Chunk Size" + "title": "Input Preview" }, - "compaction_prompt": { + "output_storage_key": { "anyOf": [ { "type": "string" @@ -2842,36 +2876,56 @@ "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" + "title": "Output Storage Key" }, - "description": { + "run_status": { "anyOf": [ { - "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "description": "Optional description of the bank's purpose.", - "title": "Description" + "title": "Run Status" }, - "dimensions": { + "started_at": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Embedding dimensions (custom mode only).", - "title": "Dimensions" + "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" }, - "embedding_model": { + "batch_size": { + "title": "Batch Size", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "media_name": { "anyOf": [ { "type": "string" @@ -2880,164 +2934,132 @@ "type": "null" } ], - "description": "Custom embedding model (custom mode only).", - "title": "Embedding Model" + "title": "Media Name" }, - "max_age_days": { + "page_number": { "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" + "title": "Page Number" }, - "max_size_tokens": { + "source_mime": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "type": "string" }, { "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" + "title": "Source Mime" }, - "max_turns": { + "source_url": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Turns" + "title": "Source Url" }, - "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", + "text": { + "title": "Text", "type": "string" }, - "retention_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 30, - "description": "Content source retention in days.", - "title": "Retention Days" + "text_end": { + "title": "Text End", + "type": "integer" }, - "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" + "text_start": { + "title": "Text Start", + "type": "integer" }, - "name": { - "description": "Name of the solution", - "title": "Name", - "type": "string" + "vector": { + "items": { + "type": "number" + }, + "title": "Vector", + "type": "array" } }, "required": [ - "name" + "id", + "text_start", + "text_end", + "text", + "vector", + "batch_size", + "batch_duration" ], - "title": "CreateSolutionRequest", + "title": "ContentEmbeddingResponse", "type": "object" }, - "CreateSourceBody": { - "description": "Request body for creating a content source.", + "CreateAlertConfigRequest": { "properties": { - "chunk_overlap": { + "agent_id": { "anyOf": [ { - "minimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" + "description": "Agent ID (for agent alerts)", + "title": "Agent Id" }, - "chunk_size": { + "alert_type": { + "description": "Alert type", + "title": "Alert Type", + "type": "string" + }, + "cooldown_minutes": { "anyOf": [ { - "exclusiveMinimum": 0.0, "type": "integer" }, { "type": "null" } ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" + "description": "Cooldown period in minutes. Omit to use the per-alert-type default (1440 for credit alerts, 60 otherwise).", + "title": "Cooldown Minutes" }, - "content_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content filter type.", - "title": "Content Filter" + "distribution_type": { + "default": "owner", + "description": "Distribution type (owner, owner_admins, selected_members)", + "title": "Distribution Type", + "type": "string" }, - "dimensions": { + "enabled": { + "default": true, + "description": "Whether the alert config is enabled", + "title": "Enabled", + "type": "boolean" + }, + "recipient_user_ids": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "description": "Embedding dimensions override.", - "title": "Dimensions" + "description": "User IDs for selected_members distribution", + "title": "Recipient User Ids" }, - "embedding_model": { + "source_connection_id": { "anyOf": [ { "type": "string" @@ -3046,43 +3068,49 @@ "type": "null" } ], - "description": "Embedding model override.", - "title": "Embedding Model" + "description": "Source connection ID (for source alerts)", + "title": "Source Connection Id" }, - "index_mode": { + "threshold": { "anyOf": [ { - "$ref": "#/components/schemas/SourceIndexMode" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom." - }, - "media_types": { + "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": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "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" + "title": "Description" }, - "name": { - "description": "Source name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" + "enabled": { + "default": true, + "title": "Enabled", + "type": "boolean" }, - "polling": { + "evaluation_prompt": { "anyOf": [ { "type": "string" @@ -3091,299 +3119,264 @@ "type": "null" } ], - "description": "Polling interval (e.g. hourly, daily).", - "title": "Polling" + "title": "Evaluation Prompt" }, - "polling_action": { + "evaluation_tier": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/AgentEvaluationTier" }, { "type": "null" } - ], - "description": "Polling action.", - "title": "Polling Action" + ] }, - "polling_max_items": { + "expectation_config": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Max items per poll.", - "title": "Polling Max Items" + "title": "Expectation Config" }, - "retention": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period in days.", - "title": "Retention" + "pass_threshold": { + "default": 0.5, + "maximum": 1.0, + "minimum": 0.0, + "title": "Pass Threshold", + "type": "number" }, - "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", + "step_id": { + "maxLength": 255, + "minLength": 1, + "title": "Step Id", "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" + "step_id" ], - "title": "CreateSourceBody", + "title": "CreateEvaluationCriteriaRequest", "type": "object" }, - "DmarcFailingSourceResponse": { + "CreateEvaluationResultRequest": { + "description": "Request body for recording an evaluation result.", "properties": { - "failed_count": { - "title": "Failed Count", - "type": "integer" + "agent_run_id": { + "format": "uuid", + "title": "Agent Run Id", + "type": "string" }, - "header_from": { + "agent_step_run_id": { "anyOf": [ { + "format": "uuid", "type": "string" }, { "type": "null" } ], - "title": "Header From" + "title": "Agent Step Run Id" }, - "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" + "details": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Details" }, - "failed_messages": { - "title": "Failed Messages", + "flagged": { + "default": false, + "title": "Flagged", + "type": "boolean" + }, + "retry_count": { + "default": 0, + "minimum": 0.0, + "title": "Retry Count", "type": "integer" }, - "monitored": { - "default": true, - "title": "Monitored", + "retry_triggered": { + "default": false, + "title": "Retry Triggered", "type": "boolean" }, - "pass_rate": { + "score": { "anyOf": [ { + "maximum": 1.0, + "minimum": 0.0, "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" + "title": "Score" }, - "window_days": { - "title": "Window Days", - "type": "integer" + "status": { + "$ref": "#/components/schemas/EvaluationStatus" } }, "required": [ - "window_days", - "report_count", - "total_messages", - "passed_messages", - "failed_messages" + "agent_run_id", + "status" ], - "title": "DmarcSummaryResponse", + "title": "CreateEvaluationResultRequest", "type": "object" }, - "DnsProviderResponse": { + "CreateExperimentResponse": { "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", + "experiment_id": { + "title": "Experiment Id", "type": "string" }, - "tips": { - "items": { - "type": "string" - }, - "title": "Tips", - "type": "array" - }, - "txt_quotes": { - "default": "strip", - "title": "Txt Quotes", + "status": { + "title": "Status", "type": "string" } }, "required": [ - "key", - "name" + "experiment_id", + "status" ], - "title": "DnsProviderResponse", + "title": "CreateExperimentResponse", "type": "object" }, - "DnsRecordResponse": { + "CreateKnowledgeBaseBody": { + "description": "Request body for creating a knowledge base.", "properties": { - "detail": { + "default_score_threshold": { "anyOf": [ { - "type": "string" + "maximum": 1.0, + "minimum": 0.0, + "type": "number" }, { "type": "null" } ], - "title": "Detail" - }, - "key": { - "title": "Key", - "type": "string" + "description": "Prefilled into Minimum Rerank Score on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", + "title": "Default Score Threshold" }, - "mx_host": { + "default_top_k": { "anyOf": [ { - "type": "string" + "exclusiveMinimum": 0.0, + "maximum": 200.0, + "type": "integer" }, { "type": "null" } ], - "title": "Mx Host" + "description": "Prefilled into Top K on a new retrieval step in the editor. Not applied at retrieval time.", + "title": "Default Top K" }, - "mx_priority": { + "default_top_n": { "anyOf": [ { + "exclusiveMinimum": 0.0, + "maximum": 200.0, "type": "integer" }, { "type": "null" } ], - "title": "Mx Priority" + "description": "Prefilled into Top N on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", + "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" }, - "ok": { - "title": "Ok", - "type": "boolean" - }, - "relative_name": { - "title": "Relative Name", - "type": "string" - }, - "type": { - "title": "Type", - "type": "string" + "reranker_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Reranker model to use \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to disable reranking (not a value from that list). Omit it for a default chosen from the sources (\"none\" when every source embeds media natively, whose chunks carry no text for a reranker to score). \"\" is accepted as a synonym for \"none\".", + "title": "Reranker Model" }, - "value": { - "title": "Value", - "type": "string" + "source_ids": { + "description": "List of source connection IDs to link.", + "items": { + "type": "string" + }, + "minItems": 1, + "title": "Source Ids", + "type": "array" } }, "required": [ - "key", - "type", "name", - "relative_name", - "value", - "ok" + "source_ids" ], - "title": "DnsRecordResponse", + "title": "CreateKnowledgeBaseBody", "type": "object" }, - "DocsSearchResultResponse": { + "CreateMemoryBankBody": { + "description": "Request body for creating a memory bank.", "properties": { - "anchor": { + "chunk_overlap": { "anyOf": [ { - "type": "string" + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Anchor" + "description": "Chunk overlap (custom mode only).", + "title": "Chunk Overlap" }, - "doc_slug": { - "title": "Doc Slug", - "type": "string" + "chunk_size": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Chunk size (custom mode only).", + "title": "Chunk Size" }, - "highlight": { + "compaction_prompt": { "anyOf": [ { "type": "string" @@ -3392,58 +3385,36 @@ "type": "null" } ], - "title": "Highlight" - }, - "score": { - "title": "Score", - "type": "number" + "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" }, - "snippet": { + "description": { "anyOf": [ { + "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "title": "Snippet" + "description": "Optional description of the bank's purpose.", + "title": "Description" }, - "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" + "dimensions": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Embedding dimensions (custom mode only).", + "title": "Dimensions" }, - "error_message": { + "embedding_model": { "anyOf": [ { "type": "string" @@ -3452,148 +3423,144 @@ "type": "null" } ], - "title": "Error Message" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "is_primary": { - "title": "Is Primary", - "type": "boolean" - }, - "kind": { - "title": "Kind", - "type": "string" + "description": "Custom embedding model (custom mode only).", + "title": "Embedding Model" }, - "last_checked_at": { + "max_age_days": { "anyOf": [ { - "format": "date-time", - "type": "string" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Last Checked At" + "description": "DEPRECATED and no longer applied. Age used to trigger compaction, which duplicated retention_days \u2014 both removed the same entries at the same age. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients.", + "title": "Max Age Days" }, - "provider": { + "max_size_tokens": { "anyOf": [ { - "$ref": "#/components/schemas/DnsProviderResponse" + "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" }, - "regressing": { - "default": false, - "title": "Regressing", - "type": "boolean" + "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" }, - "status": { - "title": "Status", + "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" }, - "verified": { - "default": false, - "title": "Verified", - "type": "boolean" + "name": { + "description": "Memory bank name.", + "maxLength": 255, + "minLength": 1, + "title": "Name", + "type": "string" }, - "verified_at": { + "retention_days": { "anyOf": [ { - "format": "date-time", - "type": "string" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Verified At" + "description": "Retention in days \u2014 when entries are deleted outright, text and embeddings. This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank \u2014 unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the caller expressed \u2014 while a general bank keeps entries indefinitely. Send an explicit value (or null for indefinite) to be unambiguous on every version.", + "title": "Retention Days" }, - "zone_apex": { - "default": "", - "title": "Zone Apex", + "strip_quoted_reply_chains": { + "default": false, + "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", + "title": "Strip Quoted Reply Chains", + "type": "boolean" + }, + "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": [ - "id", - "domain", - "kind", - "status", - "is_primary" + "name" ], - "title": "EmailDomainResponse", + "title": "CreateMemoryBankBody", "type": "object" }, - "EmailDomainsListResponse": { + "CreateSolutionRequest": { + "description": "Request model for creating a new solution", "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" + "description": { + "default": "", + "description": "Description of the solution", + "title": "Description", + "type": "string" }, - "vanity_plan_names": { - "items": { - "type": "string" - }, - "title": "Vanity Plan Names", - "type": "array" + "name": { + "description": "Name of the solution", + "title": "Name", + "type": "string" } }, - "title": "EmailDomainsListResponse", + "required": [ + "name" + ], + "title": "CreateSolutionRequest", "type": "object" }, - "EmailTriggerConfigResponse": { - "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", + "CreateSourceBody": { + "description": "Request body for creating a content source.", "properties": { - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" + "chunk_overlap": { + "anyOf": [ + { + "minimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Chunk overlap for content processing.", + "title": "Chunk Overlap" }, - "email_addresses": { - "items": { - "type": "string" - }, - "title": "Email Addresses", - "type": "array" + "chunk_size": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Chunk size for content processing.", + "title": "Chunk Size" }, - "email_alias": { + "content_filter": { "anyOf": [ { "type": "string" @@ -3602,73 +3569,68 @@ "type": "null" } ], - "title": "Email Alias" + "description": "Content filter type.", + "title": "Content Filter" }, - "email_allowed_senders": { + "dimensions": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "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" + "description": "Embedding dimensions override.", + "title": "Dimensions" }, - "email_require_sender_auth": { - "default": true, - "title": "Email Require Sender Auth", - "type": "boolean" - }, - "trigger_id": { - "format": "uuid", - "title": "Trigger Id", - "type": "string" + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "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" }, - "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" + "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." }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" + "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 (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. Omit / [] for text-only.", + "title": "Media Types" }, - "created_at": { - "title": "Created At", + "name": { + "description": "Source name.", + "maxLength": 255, + "minLength": 1, + "title": "Name", "type": "string" }, - "description": { + "polling": { "anyOf": [ { "type": "string" @@ -3677,18 +3639,10 @@ "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" + "description": "Polling interval (e.g. hourly, daily).", + "title": "Polling" }, - "evaluation_prompt": { + "polling_action": { "anyOf": [ { "type": "string" @@ -3697,59 +3651,41 @@ "type": "null" } ], - "title": "Evaluation Prompt" + "description": "Polling action.", + "title": "Polling Action" }, - "evaluation_tier": { + "polling_max_items": { "anyOf": [ { - "type": "string" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Evaluation Tier" + "description": "Max items per poll.", + "title": "Polling Max Items" }, - "expectation_config": { + "retention": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Expectation Config" + "description": "Retention period in days.", + "title": "Retention" }, - "id": { - "format": "uuid", - "title": "Id", + "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" }, - "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": { + "url_id": { "anyOf": [ { "type": "string" @@ -3758,266 +3694,173 @@ "type": "null" } ], - "title": "Step Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" + "description": "URL record ID (required for rss/website sources).", + "title": "Url Id" } }, "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" + "name", + "source_type" ], - "title": "EvaluationCriteriaResponse", + "title": "CreateSourceBody", "type": "object" }, - "EvaluationResultListResponse": { - "description": "Paginated list of evaluation results.", + "DmarcFailingSourceResponse": { "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", + "failed_count": { + "title": "Failed Count", "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": { + "header_from": { "anyOf": [ { - "format": "uuid", "type": "string" }, { "type": "null" } ], - "title": "Agent Step Run Id" + "title": "Header From" }, - "created_at": { - "title": "Created At", + "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" }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" + "failed_messages": { + "title": "Failed Messages", + "type": "integer" }, - "details": { + "monitored": { + "default": true, + "title": "Monitored", + "type": "boolean" + }, + "pass_rate": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "number" }, { "type": "null" } ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" + "title": "Pass Rate" }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" + "passed_messages": { + "title": "Passed Messages", + "type": "integer" }, - "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", + "report_count": { + "title": "Report Count", "type": "integer" }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" + "top_failing_sources": { + "items": { + "$ref": "#/components/schemas/DmarcFailingSourceResponse" + }, + "title": "Top Failing Sources", + "type": "array" }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" + "total_messages": { + "title": "Total Messages", + "type": "integer" }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" + "window_days": { + "title": "Window Days", + "type": "integer" } }, "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at" + "window_days", + "report_count", + "total_messages", + "passed_messages", + "failed_messages" ], - "title": "EvaluationResultResponse", + "title": "DmarcSummaryResponse", "type": "object" }, - "EvaluationResultSummaryResponse": { - "description": "Aggregated pass/fail/error counts and average score for a criteria.", + "DnsProviderResponse": { "properties": { - "average_score": { + "dashboard_url": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "description": "Mean score across all evaluated results, or null if none.", - "title": "Average Score" - }, - "error": { - "title": "Error", - "type": "integer" + "title": "Dashboard Url" }, - "failed": { - "title": "Failed", - "type": "integer" + "key": { + "title": "Key", + "type": "string" }, - "flagged": { - "title": "Flagged", - "type": "integer" + "mx_priority_separate": { + "default": true, + "title": "Mx Priority Separate", + "type": "boolean" }, - "passed": { - "title": "Passed", - "type": "integer" + "name": { + "title": "Name", + "type": "string" }, - "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": { + "tips": { "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" + "type": "string" }, - "title": "Data", + "title": "Tips", "type": "array" }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" + "txt_quotes": { + "default": "strip", + "title": "Txt Quotes", + "type": "string" } }, "required": [ - "data", - "total", - "page", - "limit" + "key", + "name" ], - "title": "EvaluationResultWithCriteriaListResponse", + "title": "DnsProviderResponse", "type": "object" }, - "EvaluationResultWithCriteriaResponse": { - "description": "Evaluation result including criteria context for aggregated listing.", + "DnsRecordResponse": { "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { + "detail": { "anyOf": [ { - "format": "uuid", "type": "string" }, { "type": "null" } ], - "title": "Agent Step Run Id" + "title": "Detail" }, - "created_at": { - "title": "Created At", + "key": { + "title": "Key", "type": "string" }, - "criteria_description": { + "mx_host": { "anyOf": [ { "type": "string" @@ -4026,66 +3869,69 @@ "type": "null" } ], - "title": "Criteria Description" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" + "title": "Mx Host" }, - "details": { + "mx_priority": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" + "title": "Mx Priority" }, - "evaluated_at": { - "title": "Evaluated At", + "name": { + "title": "Name", "type": "string" }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", + "ok": { + "title": "Ok", "type": "boolean" }, - "id": { - "format": "uuid", - "title": "Id", + "relative_name": { + "title": "Relative Name", "type": "string" }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" + "type": { + "title": "Type", + "type": "string" }, - "score": { + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "key", + "type", + "name", + "relative_name", + "value", + "ok" + ], + "title": "DnsRecordResponse", + "type": "object" + }, + "DocsSearchResultResponse": { + "properties": { + "anchor": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" + "title": "Anchor" }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", + "doc_slug": { + "title": "Doc Slug", "type": "string" }, - "step_id": { + "highlight": { "anyOf": [ { "type": "string" @@ -4094,164 +3940,43 @@ "type": "null" } ], - "title": "Step Id" + "title": "Highlight" + }, + "score": { + "title": "Score", + "type": "number" + }, + "snippet": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Snippet" + }, + "title": { + "title": "Title", + "type": "string" } }, "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" + "doc_slug", + "title", + "snippet", + "score", + "anchor", + "highlight" ], - "title": "EvaluationStatus", - "type": "string" - }, - "ExamplePrompt": { - "additionalProperties": { - "type": "string" - }, + "title": "DocsSearchResultResponse", "type": "object" }, - "ExecutedActionResponse": { - "description": "A single executed action result.", + "EffortOptionsResponse": { + "description": "The reasoning-effort values a model accepts.", "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": { + "default": { "anyOf": [ { "type": "string" @@ -4260,50 +3985,45 @@ "type": "null" } ], - "description": "ID of the affected resource.", - "title": "Resource Id" + "description": "The vendor's default level, when known.", + "title": "Default" }, - "resource_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the affected resource.", - "title": "Resource Type" + "kind": { + "description": "`levels` today: `values` lists them.", + "title": "Kind", + "type": "string" }, - "success": { - "default": true, - "description": "Whether the action succeeded.", - "title": "Success", - "type": "boolean" + "values": { + "description": "Accepted values, weakest first.", + "items": { + "type": "string" + }, + "title": "Values", + "type": "array" } }, "required": [ - "action_type", - "description" + "kind" ], - "title": "ExecutedActionResponse", + "title": "EffortOptionsResponse", "type": "object" }, - "ExperimentDetailResponse": { + "EmailDomainResponse": { "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" + "delegated": { + "default": false, + "title": "Delegated", + "type": "boolean" }, - "created_at": { - "title": "Created At", + "dns_records": { + "items": { + "$ref": "#/components/schemas/DnsRecordResponse" + }, + "title": "Dns Records", + "type": "array" + }, + "domain": { + "title": "Domain", "type": "string" }, "error_message": { @@ -4317,67 +4037,234 @@ ], "title": "Error Message" }, - "evaluation_complexity": { - "title": "Evaluation Complexity", + "id": { + "format": "uuid", + "title": "Id", "type": "string" }, - "evaluation_mode": { - "title": "Evaluation Mode", + "is_primary": { + "title": "Is Primary", + "type": "boolean" + }, + "kind": { + "title": "Kind", "type": "string" }, - "evaluator_model_id": { + "last_checked_at": { "anyOf": [ { + "format": "date-time", "type": "string" }, { "type": "null" } ], - "title": "Evaluator Model Id" + "title": "Last Checked At" }, - "id": { - "title": "Id", + "provider": { + "anyOf": [ + { + "$ref": "#/components/schemas/DnsProviderResponse" + }, + { + "type": "null" + } + ] + }, + "regressing": { + "default": false, + "title": "Regressing", + "type": "boolean" + }, + "status": { + "title": "Status", "type": "string" }, - "include_step_output_in_evaluation": { - "title": "Include Step Output In Evaluation", + "verified": { + "default": false, + "title": "Verified", "type": "boolean" }, - "json_template": { + "verified_at": { "anyOf": [ { + "format": "date-time", "type": "string" }, { "type": "null" } ], - "title": "Json Template" + "title": "Verified At" }, - "progress_current": { + "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": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Progress Current" + "title": "Email Alias" }, - "progress_message": { + "email_allowed_senders": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Progress Message" + "title": "Email Allowed Senders" }, - "progress_total": { + "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" + }, + "EmbeddingModalityRateResponse": { + "description": "Per-modality rate for a multi-modal embedder.\n\nThe default ``credits`` field on :class:`EmbeddingModelResponse` is the\ntext rate (credits per ~1k English words). Embedders that index image or\nvideo chunks natively charge those modalities at a different rate and unit\n\u2014 e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices\nvideo per second. Surfacing the modality and unit lets a caller render an\nhonest cost breakdown alongside the text rate.", + "properties": { + "credits": { + "description": "Rate value in the unit below", + "title": "Credits", + "type": "number" + }, + "modality": { + "description": "Modality kind, e.g. image / video", + "title": "Modality", + "type": "string" + }, + "unit": { + "description": "Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens).", + "title": "Unit", + "type": "string" + } + }, + "required": [ + "modality", + "credits", + "unit" + ], + "title": "EmbeddingModalityRateResponse", + "type": "object" + }, + "EmbeddingModelListResponse": { + "description": "Legacy (header-less) response shape for the embedder catalog.", + "properties": { + "default_dimension": { "anyOf": [ { "type": "integer" @@ -4386,32 +4273,60 @@ "type": "null" } ], - "title": "Progress Total" - }, - "prompt": { - "title": "Prompt", - "type": "string" + "description": "Dimensions used with the default embedding model", + "title": "Default Dimension" }, - "result_data": { + "default_model_type": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Result Data" + "description": "Embedding model used when a source does not override it", + "title": "Default Model Type" }, - "selected_model_ids": { + "file_processing_credits_per_mb": { + "description": "Credits per MB for file processing at ingest", + "title": "File Processing Credits Per Mb", + "type": "number" + }, + "models": { + "description": "Available embedding models", "items": { - "type": "string" + "$ref": "#/components/schemas/EmbeddingModelResponse" }, - "title": "Selected Model Ids", + "title": "Models", "type": "array" }, - "selected_step_output": { + "storage_credits": { + "description": "Monthly storage credits per dimension count", + "items": { + "$ref": "#/components/schemas/EmbeddingStorageCreditsResponse" + }, + "title": "Storage Credits", + "type": "array" + } + }, + "required": [ + "models", + "storage_credits", + "file_processing_credits_per_mb" + ], + "title": "EmbeddingModelListResponse", + "type": "object" + }, + "EmbeddingModelResponse": { + "description": "Information about an embedding model.", + "properties": { + "credits": { + "description": "Estimated credits per 1,000 English words", + "title": "Credits", + "type": "number" + }, + "description": { "anyOf": [ { "type": "string" @@ -4420,148 +4335,90 @@ "type": "null" } ], - "title": "Selected Step Output" + "description": "Model description", + "title": "Description" }, - "started_at": { + "dimensions": { + "description": "Dimensions options", + "items": { + "type": "integer" + }, + "title": "Dimensions", + "type": "array" + }, + "is_new": { + "default": false, + "description": "Whether the model is newly released", + "title": "Is New", + "type": "boolean" + }, + "max_input_tokens": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Started At" + "description": "Max input tokens per request", + "title": "Max Input Tokens" }, - "status": { - "title": "Status", + "model_id": { + "description": "Model identifier", + "title": "Model Id", "type": "string" }, - "system_prompt": { - "title": "System Prompt", + "model_type": { + "description": "Full model type identifier (enum value). This is the value to send as embedding_model when creating a source.", + "title": "Model Type", "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": { + }, + "mteb_retrieval_score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "MTEB retrieval score", + "title": "Mteb Retrieval Score" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable model name", + "title": "Name" + }, + "per_modality_rates": { + "description": "Non-text rates the vendor charges for this embedder (image, video, audio). Empty for text-only embedders.", "items": { - "$ref": "#/components/schemas/ExperimentSummaryResponse" + "$ref": "#/components/schemas/EmbeddingModalityRateResponse" }, - "title": "Experiments", + "title": "Per Modality Rates", "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" + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model provider identifier", + "title": "Provider" }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ExportListResponse", - "type": "object" - }, - "GenerateAgentStepsRequest": { - "properties": { - "agent_description": { + "speed": { "anyOf": [ { "type": "string" @@ -4570,15 +4427,14 @@ "type": "null" } ], - "description": "Agent description for additional AI context.", - "title": "Agent Description" + "description": "Model processing speed", + "title": "Speed" }, - "agent_steps": { + "supported_input_media": { "anyOf": [ { "items": { - "additionalProperties": true, - "type": "object" + "type": "string" }, "type": "array" }, @@ -4586,16 +4442,25 @@ "type": "null" } ], - "description": "Current agent step hierarchy for context when modifying.", - "title": "Agent Steps" + "description": "Modalities the embedder accepts on input (short kinds like text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its embedder lists here.", + "title": "Supported Input Media" }, - "mode": { - "default": "generate_full", - "description": "'generate_full' to create from scratch, 'modify_workflow' to refine.", - "title": "Mode", - "type": "string" + "supported_languages": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Supported languages", + "title": "Supported Languages" }, - "trigger_type": { + "url": { "anyOf": [ { "type": "string" @@ -4604,50 +4469,58 @@ "type": "null" } ], - "description": "Agent trigger type for context (e.g. 'dynamic_input', 'content_added').", - "title": "Trigger Type" + "description": "Model documentation URL", + "title": "Url" + } + }, + "required": [ + "model_id", + "model_type", + "dimensions", + "credits" + ], + "title": "EmbeddingModelResponse", + "type": "object" + }, + "EmbeddingStorageCreditsResponse": { + "description": "Monthly storage credits per stored record at a dimension count.", + "properties": { + "credits": { + "description": "Credits per record per month", + "title": "Credits", + "type": "integer" }, - "user_input": { - "description": "Natural language description of the desired agent workflow.", - "title": "User Input", - "type": "string" + "dimensions": { + "description": "Number of embedding dimensions", + "title": "Dimensions", + "type": "integer" } }, "required": [ - "user_input" + "dimensions", + "credits" ], - "title": "GenerateAgentStepsRequest", + "title": "EmbeddingStorageCreditsResponse", "type": "object" }, - "GenerateAgentStepsResponse": { + "EvaluationCriteriaResponse": { + "description": "Response schema for evaluation criteria.", "properties": { - "agent_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Suggested agent-level configuration, if any.", - "title": "Agent Config" + "account_id": { + "format": "uuid", + "title": "Account Id", + "type": "string" }, - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", + "agent_id": { + "format": "uuid", + "title": "Agent 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" + "created_at": { + "title": "Created At", + "type": "string" }, - "intent_assessment": { + "description": { "anyOf": [ { "type": "string" @@ -4656,408 +4529,331 @@ "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" + "title": "Description" }, - "note": { - "description": "AI explanation of the proposed workflow.", - "title": "Note", - "type": "string" + "enabled": { + "title": "Enabled", + "type": "boolean" }, - "steps": { - "description": "Generated agent steps.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Steps", - "type": "array" + "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" }, - "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": { + "evaluation_prompt": { "anyOf": [ { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "description": "Current agent step hierarchy for context.", - "title": "Agent Steps" + "title": "Evaluation Prompt" }, - "current_config": { + "evaluation_tier": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "Current step configuration to refine, if any.", - "title": "Current Config" + "title": "Evaluation Tier" }, - "step_id": { + "expectation_config": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "ID of the specific step to refine. Omit for new steps.", - "title": "Step Id" + "title": "Expectation Config" }, - "step_type": { - "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", - "title": "Step Type", + "id": { + "format": "uuid", + "title": "Id", "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" + "max_retries": { + "title": "Max Retries", + "type": "integer" }, - "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" + "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": "Example Prompts", - "type": "array" + "title": "Result Summary", + "type": "object" }, - "note": { - "description": "AI explanation of the proposed configuration.", - "title": "Note", - "type": "string" + "retry_on_failure": { + "title": "Retry On Failure", + "type": "boolean" }, - "resulting_config": { + "step_id": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "The proposed step configuration.", - "title": "Resulting Config" + "title": "Step Id" }, - "step_type": { - "description": "The step type that was generated.", - "title": "Step Type", + "updated_at": { + "title": "Updated At", "type": "string" - }, - "success": { - "description": "Whether a valid configuration was generated.", - "title": "Success", - "type": "boolean" } }, "required": [ - "conversation_id", - "step_type", - "note", - "success" + "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": "GenerateStepConfigResponse", + "title": "EvaluationCriteriaResponse", "type": "object" }, - "GenerationTierListResponse": { - "description": "``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients\nget the canonical ``{data, pagination}`` envelope.", + "EvaluationResultListResponse": { + "description": "Paginated list of evaluation results.", "properties": { - "tiers": { + "data": { "items": { - "$ref": "#/components/schemas/GenerationTierResponse" + "$ref": "#/components/schemas/EvaluationResultResponse" }, - "title": "Tiers", + "title": "Data", "type": "array" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" } }, "required": [ - "tiers" + "data", + "total", + "page", + "limit" ], - "title": "GenerationTierListResponse", + "title": "EvaluationResultListResponse", "type": "object" }, - "GenerationTierResponse": { + "EvaluationResultResponse": { + "description": "Response schema for a single evaluation result.", "properties": { - "credits_per_unit": { + "agent_run_id": { + "format": "uuid", + "title": "Agent Run Id", + "type": "string" + }, + "agent_step_run_id": { "anyOf": [ { - "type": "integer" + "format": "uuid", + "type": "string" }, { "type": "null" } ], - "title": "Credits Per Unit" - }, - "modality": { - "title": "Modality", - "type": "string" + "title": "Agent Step Run Id" }, - "model_id": { - "title": "Model Id", + "created_at": { + "title": "Created At", "type": "string" }, - "model_name": { - "title": "Model Name", + "criteria_id": { + "format": "uuid", + "title": "Criteria Id", "type": "string" }, - "price_label": { + "details": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Price Label" + "description": "Evaluation details including explanation and raw LLM response.", + "title": "Details" }, - "tier": { - "title": "Tier", + "evaluated_at": { + "title": "Evaluated At", "type": "string" }, - "unit_label": { + "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": "string" + "type": "number" }, { "type": "null" } ], - "title": "Unit Label" + "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": [ - "modality", - "tier", - "model_id", - "model_name", - "credits_per_unit", - "unit_label", - "price_label" + "id", + "criteria_id", + "agent_run_id", + "agent_step_run_id", + "status", + "retry_triggered", + "retry_count", + "flagged", + "evaluated_at", + "created_at" ], - "title": "GenerationTierResponse", + "title": "EvaluationResultResponse", "type": "object" }, - "GovernanceAiAcceptResponse": { - "description": "Response from accepting a governance AI assistant plan.", + "EvaluationResultSummaryResponse": { + "description": "Aggregated pass/fail/error counts and average score for a criteria.", "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": { + "average_score": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Overall error message if the plan failed, or null.", - "title": "Error" + "description": "Mean score across all evaluated results, or null if none.", + "title": "Average Score" }, - "success": { - "description": "Whether all actions were applied successfully.", - "title": "Success", - "type": "boolean" + "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": [ - "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" + "total", + "passed", + "failed", + "error", + "flagged" ], - "title": "GovernanceAiAssistantResponse", + "title": "EvaluationResultSummaryResponse", "type": "object" }, - "HTTPValidationError": { + "EvaluationResultWithCriteriaListResponse": { + "description": "Paginated list of evaluation results with criteria context.", "properties": { - "detail": { + "data": { "items": { - "$ref": "#/components/schemas/ValidationError" + "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" }, - "title": "Detail", + "title": "Data", "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", + "limit": { + "title": "Limit", "type": "integer" }, - "message": { - "description": "Human-readable description of the problem.", - "title": "Message", - "type": "string" + "page": { + "title": "Page", + "type": "integer" }, - "path": { - "description": "Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`.", - "title": "Path", - "type": "string" + "total": { + "title": "Total", + "type": "integer" } }, "required": [ - "line", - "column", - "path", - "message" + "data", + "total", + "page", + "limit" ], - "title": "ImportFieldErrorModel", + "title": "EvaluationResultWithCriteriaListResponse", "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.", + "EvaluationResultWithCriteriaResponse": { + "description": "Evaluation result including criteria context for aggregated listing.", "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", + "agent_run_id": { + "format": "uuid", + "title": "Agent Run Id", "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": { + "agent_step_run_id": { "anyOf": [ { "format": "uuid", @@ -5067,52 +4863,81 @@ "type": "null" } ], - "title": "Agent Id" + "title": "Agent Step Run Id" }, "created_at": { "title": "Created At", "type": "string" }, - "id": { + "criteria_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Criteria Description" + }, + "criteria_id": { "format": "uuid", - "title": "Id", + "title": "Criteria Id", "type": "string" }, - "message_id": { + "details": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Message Id" + "description": "Evaluation details including explanation and raw LLM response.", + "title": "Details" }, - "reason": { - "title": "Reason", + "evaluated_at": { + "title": "Evaluated At", "type": "string" }, - "recipient": { - "title": "Recipient", - "type": "string" + "flagged": { + "description": "True when the result was flagged for human review.", + "title": "Flagged", + "type": "boolean" }, - "sender": { - "title": "Sender", + "id": { + "format": "uuid", + "title": "Id", "type": "string" }, - "sender_ip": { + "retry_count": { + "title": "Retry Count", + "type": "integer" + }, + "retry_triggered": { + "title": "Retry Triggered", + "type": "boolean" + }, + "score": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Sender Ip" + "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", + "title": "Score" }, - "subject": { + "status": { + "description": "Outcome status: pending, passed, failed, skipped, or error.", + "title": "Status", + "type": "string" + }, + "step_id": { "anyOf": [ { "type": "string" @@ -5121,45 +4946,146 @@ "type": "null" } ], - "title": "Subject" + "title": "Step Id" } }, "required": [ "id", + "criteria_id", + "agent_run_id", + "agent_step_run_id", + "status", + "retry_triggered", + "retry_count", + "flagged", + "evaluated_at", "created_at", - "recipient", - "sender", - "sender_ip", - "reason", - "message_id", - "agent_id", - "subject" + "step_id", + "criteria_description" ], - "title": "InboundEmailRejectionResponse", + "title": "EvaluationResultWithCriteriaResponse", "type": "object" }, - "InboundEmailStatusResponse": { + "EvaluationRunSummaryListResponse": { + "description": "Paginated list of per-run evaluation summaries.", "properties": { - "paused": { - "title": "Paused", - "type": "boolean" + "data": { + "items": { + "$ref": "#/components/schemas/EvaluationRunSummaryResponse" + }, + "title": "Data", + "type": "array" }, - "queued_backlog": { - "title": "Queued Backlog", + "limit": { + "title": "Limit", + "type": "integer" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "total": { + "title": "Total", "type": "integer" } }, "required": [ - "paused", - "queued_backlog" - ], - "title": "InboundEmailStatusResponse", + "data", + "total", + "page", + "limit" + ], + "title": "EvaluationRunSummaryListResponse", "type": "object" }, - "InlineTextReplaceRequest": { - "description": "Request model for inline text content replacement.", + "EvaluationRunSummaryResponse": { + "description": "Per-run evaluation summary with pass/fail/error breakdown.", "properties": { - "content_type": { + "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" @@ -5168,29 +5094,28 @@ "type": "null" } ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" + "description": "Error message if failed.", + "title": "Error" }, - "metadata": { + "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": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" + "description": "ID of the affected resource.", + "title": "Resource Id" }, - "title": { + "resource_type": { "anyOf": [ { "type": "string" @@ -5199,20 +5124,26 @@ "type": "null" } ], - "description": "Optional title", - "title": "Title" + "description": "Type of the affected resource.", + "title": "Resource Type" + }, + "success": { + "default": true, + "description": "Whether the action succeeded.", + "title": "Success", + "type": "boolean" } }, "required": [ - "text" + "action_type", + "description" ], - "title": "InlineTextReplaceRequest", + "title": "ExecutedActionResponse", "type": "object" }, - "InlineTextUploadRequest": { - "description": "Request model for inline text uploads.", + "ExperimentDetailResponse": { "properties": { - "content_type": { + "completed_at": { "anyOf": [ { "type": "string" @@ -5221,29 +5152,40 @@ "type": "null" } ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" + "title": "Completed At" }, - "metadata": { + "created_at": { + "title": "Created At", + "type": "string" + }, + "effort": { + "additionalProperties": { + "type": "string" + }, + "description": "The reasoning effort each model was run at, by model ID.", + "title": "Effort", + "type": "object" + }, + "error_message": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "Optional metadata object", - "title": "Metadata" + "title": "Error Message" }, - "text": { - "description": "Text content to upload", - "title": "Text", + "evaluation_complexity": { + "title": "Evaluation Complexity", "type": "string" }, - "title": { + "evaluation_mode": { + "title": "Evaluation Mode", + "type": "string" + }, + "evaluator_model_id": { "anyOf": [ { "type": "string" @@ -5252,127 +5194,50 @@ "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" + "title": "Evaluator Model Id" }, - "error": { - "const": "insufficient_credits", - "description": "Stable machine-readable error code.", - "title": "Error", + "id": { + "title": "Id", "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" + "include_step_output_in_evaluation": { + "title": "Include Step Output In Evaluation", + "type": "boolean" }, - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" + "json_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Json Template" }, - "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": { + "progress_current": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "description": "Default minimum rerank score.", - "title": "Default Score Threshold" + "title": "Progress Current" }, - "default_top_k": { + "progress_message": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Default results after reranking.", - "title": "Default Top K" + "title": "Progress Message" }, - "default_top_n": { + "progress_total": { "anyOf": [ { "type": "integer" @@ -5381,38 +5246,43 @@ "type": "null" } ], - "description": "Default number of results to return.", - "title": "Default Top N" + "title": "Progress Total" }, - "description": { + "prompt": { + "title": "Prompt", + "type": "string" + }, + "result_data": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Optional description.", - "title": "Description" - }, - "id": { - "description": "Unique knowledge base identifier.", - "title": "Id", - "type": "string" + "title": "Result Data" }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" + "selected_model_ids": { + "items": { + "type": "string" + }, + "title": "Selected Model Ids", + "type": "array" }, - "readonly": { - "default": false, - "description": "Whether the knowledge base is read-only.", - "title": "Readonly", - "type": "boolean" + "selected_step_output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Selected Step Output" }, - "reranker_model": { + "started_at": { "anyOf": [ { "type": "string" @@ -5421,134 +5291,171 @@ "type": "null" } ], - "description": "Reranker model in use.", - "title": "Reranker Model" + "title": "Started At" }, - "sources": { - "description": "Linked source connections.", - "items": { - "$ref": "#/components/schemas/SourceConnectionResponseModel" - }, - "title": "Sources", - "type": "array" + "status": { + "title": "Status", + "type": "string" }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", + "system_prompt": { + "title": "System Prompt", "type": "string" } }, "required": [ "id", - "name", + "status", "created_at", - "updated_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": "KnowledgeBase", + "title": "ExperimentDetailResponse", "type": "object" }, - "LinkResourcesRequest": { + "ExperimentListResponse": { + "description": "``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+\nclients get the canonical ``{data, pagination}`` envelope.", "properties": { - "ids": { - "description": "Resource IDs to link", + "experiments": { "items": { - "format": "uuid", - "type": "string" + "$ref": "#/components/schemas/ExperimentSummaryResponse" }, - "minItems": 1, - "title": "Ids", + "title": "Experiments", "type": "array" + }, + "total": { + "title": "Total", + "type": "integer" } }, "required": [ - "ids" + "experiments", + "total" ], - "title": "LinkResourcesRequest", + "title": "ExperimentListResponse", "type": "object" }, - "MarkAiSuggestionRequest": { + "ExperimentSummaryResponse": { "properties": { - "accepted": { - "description": "True to accept the suggestion, false to decline it.", - "title": "Accepted", - "type": "boolean" + "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": [ - "accepted" + "id", + "status", + "created_at", + "selected_model_ids", + "evaluation_mode", + "evaluation_complexity" ], - "title": "MarkAiSuggestionRequest", + "title": "ExperimentSummaryResponse", "type": "object" }, - "MarkConversationTurnRequest": { - "properties": { - "accepted": { - "description": "Whether the suggestion was accepted", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" + "ExportFormat": { + "description": "Supported export file formats.", + "enum": [ + "jsonl", + "csv", + "parquet", + "zip" ], - "title": "MarkConversationTurnRequest", - "type": "object" + "title": "ExportFormat", + "type": "string" }, - "MeResponse": { + "ExportListResponse": { + "description": "Paginated list of export jobs.", "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "organizations": { - "items": { - "$ref": "#/components/schemas/OrganizationInfoResponse" - }, - "title": "Organizations", + "data": { + "items": {}, + "title": "Data", "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" } }, "required": [ - "account_id", - "organizations" + "data", + "pagination" ], - "title": "MeResponse", + "title": "ExportListResponse", "type": "object" }, - "MemoryBankAiAssistantResponse": { - "description": "Response from the memory bank AI assistant.", + "GenerateAgentStepsRequest": { "properties": { - "config": { + "agent_description": { "anyOf": [ { - "$ref": "#/components/schemas/MemoryBankConfigResponse" + "type": "string" }, { "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" + "description": "Agent description for additional AI context.", + "title": "Agent Description" }, - "note": { - "description": "AI-generated explanation.", - "title": "Note", + "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" }, - "prompt_call_id": { + "trigger_type": { "anyOf": [ { "type": "string" @@ -5557,39 +5464,50 @@ "type": "null" } ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" + "description": "Agent trigger type for context (e.g. 'dynamic_input', 'content_added').", + "title": "Trigger Type" }, - "success": { - "default": false, - "description": "Whether generation succeeded.", - "title": "Success", - "type": "boolean" + "user_input": { + "description": "Natural language description of the desired agent workflow.", + "title": "User Input", + "type": "string" } }, "required": [ - "conversation_id", - "note" + "user_input" ], - "title": "MemoryBankAiAssistantResponse", + "title": "GenerateAgentStepsRequest", "type": "object" }, - "MemoryBankConfigResponse": { - "description": "Suggested memory bank configuration from the AI assistant.", + "GenerateAgentStepsResponse": { "properties": { - "compaction_prompt": { + "agent_config": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Suggested compaction prompt.", - "title": "Compaction Prompt" + "description": "Suggested agent-level configuration, if any.", + "title": "Agent Config" }, - "description": { + "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" @@ -5598,133 +5516,172 @@ "type": "null" } ], - "description": "Suggested description.", - "title": "Description" + "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" }, - "max_age_days": { + "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": [ { - "type": "integer" + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" }, { "type": "null" } ], - "description": "Max age in days.", - "title": "Max Age Days" + "description": "Current agent step hierarchy for context.", + "title": "Agent Steps" }, - "max_size_tokens": { + "current_config": { "anyOf": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Max size in tokens.", - "title": "Max Size Tokens" + "description": "Current step configuration to refine, if any.", + "title": "Current Config" }, - "max_turns": { + "step_id": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Max conversation turns.", - "title": "Max Turns" + "description": "ID of the specific step to refine. Omit for new steps.", + "title": "Step Id" }, - "mode": { - "description": "Memory bank mode.", - "title": "Mode", + "step_type": { + "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", + "title": "Step Type", "type": "string" }, - "name": { - "description": "Suggested name.", - "title": "Name", + "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" }, - "retention_days": { + "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": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Retention in days.", - "title": "Retention Days" + "description": "The proposed step configuration.", + "title": "Resulting Config" }, - "type": { - "description": "Memory bank type: conversation or general.", - "title": "Type", + "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": [ - "name", - "type", - "mode" + "conversation_id", + "step_type", + "note", + "success" ], - "title": "MemoryBankConfigResponse", + "title": "GenerateStepConfigResponse", "type": "object" }, - "MemoryBankListResponseModel": { - "description": "Paginated list of memory banks.", + "GenerationTierListResponse": { + "description": "``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients\nget the canonical ``{data, pagination}`` envelope.", "properties": { - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "memory_banks": { - "description": "List of memory banks on this page.", + "tiers": { "items": { - "$ref": "#/components/schemas/MemoryBankResponseModel" + "$ref": "#/components/schemas/GenerationTierResponse" }, - "title": "Memory Banks", + "title": "Tiers", "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" + "tiers" ], - "title": "MemoryBankListResponseModel", + "title": "GenerationTierListResponse", "type": "object" }, - "MemoryBankResponseModel": { - "description": "Response model for a single memory bank.", + "GenerationTierResponse": { "properties": { - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Character overlap between chunks.", - "title": "Chunk Overlap" - }, - "chunk_size": { + "credits_per_unit": { "anyOf": [ { "type": "integer" @@ -5733,51 +5690,21 @@ "type": "null" } ], - "description": "Characters per chunk.", - "title": "Chunk Size" + "title": "Credits Per Unit" }, - "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", + "modality": { + "title": "Modality", "type": "string" }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the memory bank's purpose.", - "title": "Description" + "model_id": { + "title": "Model Id", + "type": "string" }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Vector embedding dimensions.", - "title": "Dimensions" + "model_name": { + "title": "Model Name", + "type": "string" }, - "embedding_model": { + "price_label": { "anyOf": [ { "type": "string" @@ -5786,73 +5713,53 @@ "type": "null" } ], - "description": "Embedding model identifier.", - "title": "Embedding Model" + "title": "Price Label" }, - "id": { - "description": "Unique memory bank identifier.", - "title": "Id", + "tier": { + "title": "Tier", "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": { + "unit_label": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "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" + "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" }, - "name": { - "description": "Human-readable name.", - "title": "Name", + "conversation_id": { + "description": "Conversation ID that was accepted.", + "title": "Conversation Id", "type": "string" }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content retention period in days (null = indefinite).", - "title": "Retention Days" - }, - "source_connection_id": { + "error": { "anyOf": [ { "type": "string" @@ -5861,204 +5768,177 @@ "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" + "description": "Overall error message if the plan failed, or null.", + "title": "Error" }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" + "success": { + "description": "Whether all actions were applied successfully.", + "title": "Success", + "type": "boolean" } }, "required": [ - "id", - "name", - "type", - "mode", - "created_at", - "updated_at" + "conversation_id", + "actions_applied", + "success" ], - "title": "MemoryBank", + "title": "GovernanceAiAcceptResponse", "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.", + "GovernanceAiAssistantResponse": { + "description": "Response from the governance AI assistant generate endpoint.", "properties": { - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" + "conversation_id": { + "description": "Conversation ID to accept or decline this plan.", + "title": "Conversation Id", + "type": "string" }, - "modality": { - "title": "Modality", + "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" }, - "output_credits_per_1000_tokens": { + "prompt_call_id": { "anyOf": [ { - "type": "number" + "type": "string" }, { "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", + "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": [ - "ok" + "conversation_id", + "note", + "proposed_actions", + "success" ], - "title": "OkResponse", + "title": "GovernanceAiAssistantResponse", "type": "object" }, - "OrganizationAlertPreferenceListResponse": { + "HTTPValidationError": { "properties": { - "preferences": { + "detail": { "items": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" + "$ref": "#/components/schemas/ValidationError" }, - "title": "Preferences", + "title": "Detail", "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" } }, - "required": [ - "preferences", - "total" - ], - "title": "OrganizationAlertPreferenceListResponse", + "title": "HTTPValidationError", "type": "object" }, - "OrganizationInfoResponse": { + "ImportFieldErrorModel": { + "description": "Single agent_definition validation error with source position.", "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" + "column": { + "description": "1-indexed column in `source`.", + "title": "Column", + "type": "integer" }, - "id": { - "format": "uuid", - "title": "Id", + "line": { + "description": "1-indexed line in `source`.", + "title": "Line", + "type": "integer" + }, + "message": { + "description": "Human-readable description of the problem.", + "title": "Message", "type": "string" }, - "name": { - "title": "Name", + "path": { + "description": "Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`.", + "title": "Path", "type": "string" } }, "required": [ - "id", - "name", - "account_id" + "line", + "column", + "path", + "message" ], - "title": "OrganizationInfoResponse", + "title": "ImportFieldErrorModel", "type": "object" }, - "PaginationResponse": { - "description": "Pagination information.", + "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": { - "has_next": { - "title": "Has Next", - "type": "boolean" - }, - "has_prev": { - "title": "Has Prev", - "type": "boolean" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" + "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" }, - "pages": { - "title": "Pages", - "type": "integer" + "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" }, - "total": { - "title": "Total", - "type": "integer" + "message": { + "description": "Human-readable explanation of what was skipped and why.", + "title": "Message", + "type": "string" } }, "required": [ - "page", - "limit", - "total", - "pages", - "has_next", - "has_prev" + "category", + "message" ], - "title": "PaginationResponse", + "title": "ImportSkipResponse", "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.", + "InboundEmailRejectionResponse": { + "description": "An inbound email that was discarded without running an agent.", "properties": { - "evaluation_complexity": { - "default": "medium", - "description": "simple, medium, or complex", - "enum": [ - "simple", - "medium", - "complex" + "agent_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } ], - "title": "Evaluation Complexity", + "title": "Agent Id" + }, + "created_at": { + "title": "Created At", "type": "string" }, - "evaluation_mode": { - "default": "manual", - "description": "manual or prompt", - "enum": [ - "manual", - "prompt" - ], - "title": "Evaluation Mode", + "id": { + "format": "uuid", + "title": "Id", "type": "string" }, - "evaluator_model_id": { + "message_id": { "anyOf": [ { "type": "string" @@ -6067,16 +5947,21 @@ "type": "null" } ], - "description": "Evaluator model ID when evaluation_mode is prompt.", - "title": "Evaluator Model Id" + "title": "Message 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" + "reason": { + "title": "Reason", + "type": "string" }, - "json_template": { + "recipient": { + "title": "Recipient", + "type": "string" + }, + "sender": { + "title": "Sender", + "type": "string" + }, + "sender_ip": { "anyOf": [ { "type": "string" @@ -6085,25 +5970,9 @@ "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" + "title": "Sender Ip" }, - "selected_step_output": { + "subject": { "anyOf": [ { "type": "string" @@ -6112,37 +5981,45 @@ "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" + "title": "Subject" } }, "required": [ - "model_ids", - "prompt" + "id", + "created_at", + "recipient", + "sender", + "sender_ip", + "reason", + "message_id", + "agent_id", + "subject" ], - "title": "PlaygroundCreateRequest", + "title": "InboundEmailRejectionResponse", "type": "object" }, - "PromptModelAutoUpgradeStrategy": { - "enum": [ - "none", - "early_adopter", - "middle_of_road", - "cautious_adopter" + "InboundEmailStatusResponse": { + "properties": { + "paused": { + "title": "Paused", + "type": "boolean" + }, + "queued_backlog": { + "title": "Queued Backlog", + "type": "integer" + } + }, + "required": [ + "paused", + "queued_backlog" ], - "title": "PromptModelAutoUpgradeStrategy", - "type": "string" + "title": "InboundEmailStatusResponse", + "type": "object" }, - "PromptToolResponse": { - "description": "Response model for a prompt tool.", + "InlineTextReplaceRequest": { + "description": "Request model for inline text content replacement.", "properties": { - "description": { + "content_type": { "anyOf": [ { "type": "string" @@ -6151,53 +6028,51 @@ "type": "null" } ], - "title": "Description" + "default": "text/plain", + "description": "MIME type for the text content", + "title": "Content Type" }, - "documentation_url": { + "metadata": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Documentation Url" + "description": "Optional metadata object", + "title": "Metadata" }, - "example": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Example" + "text": { + "description": "Text content to upload", + "title": "Text", + "type": "string" }, - "headers": { + "title": { "anyOf": [ { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Headers" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "notes": { + "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" @@ -6206,24 +6081,29 @@ "type": "null" } ], - "title": "Notes" + "default": "text/plain", + "description": "MIME type for the text content", + "title": "Content Type" }, - "tool_name": { + "metadata": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Tool Name" + "description": "Optional metadata object", + "title": "Metadata" }, - "tool_type": { - "title": "Tool Type", + "text": { + "description": "Text content to upload", + "title": "Text", "type": "string" }, - "tool_type_pattern": { + "title": { "anyOf": [ { "type": "string" @@ -6232,217 +6112,188 @@ "type": "null" } ], - "title": "Tool Type Pattern" + "description": "Optional title", + "title": "Title" } }, "required": [ - "id", - "tool_type", - "name" + "text" ], - "title": "PromptToolResponse", + "title": "InlineTextUploadRequest", "type": "object" }, - "ProposedActionResponse": { - "description": "A single proposed action.", + "InsufficientCreditsDetail": { + "description": "``detail`` body for a 402 ``insufficient_credits`` response.", "properties": { - "action_type": { - "description": "Type of the proposed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the action.", - "title": "Description", + "account_id": { + "description": "UUID of the account that ran out of credits.", + "title": "Account Id", "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", + "error": { + "const": "insufficient_credits", + "description": "Stable machine-readable error code.", + "title": "Error", "type": "string" }, - "description": { - "description": "Human-readable description of what this action will do.", - "title": "Description", + "message": { + "description": "Human-readable explanation.", + "title": "Message", "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" + "error", + "message", + "account_id" ], - "title": "ResumeInboundResponse", - "type": "object" - }, - "SendTestEmailResponse": { - "properties": { - "sent": { - "default": true, - "title": "Sent", - "type": "boolean" - } - }, - "title": "SendTestEmailResponse", + "title": "InsufficientCreditsDetail", "type": "object" }, - "SetAutoBlockModeRequest": { - "description": "Set the account's governance auto-block mode (shared REST request).", + "InsufficientCreditsResponse": { + "description": "402 envelope returned when the account has exhausted its credits.", "properties": { - "mode": { - "title": "Mode", - "type": "string" + "detail": { + "$ref": "#/components/schemas/InsufficientCreditsDetail" } }, "required": [ - "mode" + "detail" ], - "title": "SetAutoBlockModeRequest", + "title": "InsufficientCreditsResponse", "type": "object" }, - "SolutionSourceConnectionResponse": { + "JsonValue": {}, + "KnowledgeBaseListResponseModel": { + "description": "Paginated list of knowledge bases.", "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" + "knowledge_bases": { + "description": "List of knowledge bases on this page.", + "items": { + "$ref": "#/components/schemas/KnowledgeBaseResponseModel" + }, + "title": "Knowledge Bases", + "type": "array" }, - "name": { - "title": "Name", - "type": "string" + "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": [ - "id", - "name" + "knowledge_bases", + "page", + "limit", + "total" ], - "title": "SolutionSourceConnectionResponse", + "title": "KnowledgeBaseListResponseModel", "type": "object" }, - "SolutionSummaryResponse": { - "description": "Response model for solution summary.", + "KnowledgeBaseResponseModel": { + "description": "Response model for a single knowledge base.", "properties": { - "agent_count": { - "description": "Number of linked agents.", - "title": "Agent Count", - "type": "integer" - }, "created_at": { - "description": "Timestamp when the solution was created.", + "description": "ISO-8601 creation timestamp.", "title": "Created At", "type": "string" }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" + "default_score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Editor default for a new retrieval step's Minimum Rerank Score.", + "title": "Default Score Threshold" }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" + "default_top_k": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Editor default for a new retrieval step's Top K.", + "title": "Default Top K" }, - "knowledge_base_count": { - "description": "Number of linked knowledge bases.", - "title": "Knowledge Base Count", - "type": "integer" + "default_top_n": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Editor default for a new retrieval step's Top N.", + "title": "Default Top N" }, - "memory_bank_count": { - "description": "Number of linked memory banks.", - "title": "Memory Bank Count", - "type": "integer" + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional description.", + "title": "Description" + }, + "id": { + "description": "Unique knowledge base identifier.", + "title": "Id", + "type": "string" }, "name": { - "description": "Name of the solution.", + "description": "Human-readable name.", "title": "Name", "type": "string" }, - "source_connection_count": { - "description": "Number of linked source connections.", - "title": "Source Connection Count", - "type": "integer" + "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": "Timestamp when the solution was last updated.", + "description": "ISO-8601 last-update timestamp.", "title": "Updated At", "type": "string" } @@ -6450,66 +6301,143 @@ "required": [ "id", "name", - "description", - "agent_count", - "knowledge_base_count", - "source_connection_count", - "memory_bank_count", "created_at", "updated_at" ], - "title": "SolutionSummaryResponse", + "title": "KnowledgeBase", "type": "object" }, - "SourceConnectionResponseModel": { - "description": "Nested source connection summary within a knowledge base response.", + "LinkResourcesRequest": { "properties": { - "id": { - "description": "Source connection identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Source connection name.", - "title": "Name", + "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" }, - "polling": { + "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": [ { - "type": "string" + "$ref": "#/components/schemas/MemoryBankConfigResponse" }, { "type": "null" } ], - "description": "Polling configuration.", - "title": "Polling" + "description": "Proposed configuration, or null." }, - "source_type": { - "description": "Type of source (rss, website, etc.).", - "title": "Source Type", + "conversation_id": { + "description": "Conversation ID for follow-up.", + "title": "Conversation Id", "type": "string" }, - "url": { - "description": "Source URL.", - "title": "Url", + "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": [ - "id", - "name", - "url", - "source_type" + "conversation_id", + "note" ], - "title": "SourceConnectionResponseModel", + "title": "MemoryBankAiAssistantResponse", "type": "object" }, - "SourceEmbeddingMigrationResponse": { - "description": "Response model for source embedding migration status.", + "MemoryBankConfigResponse": { + "description": "Suggested memory bank configuration from the AI assistant.", "properties": { - "completed_at": { + "compaction_prompt": { "anyOf": [ { "type": "string" @@ -6518,13 +6446,10 @@ "type": "null" } ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" + "description": "Suggested compaction prompt.", + "title": "Compaction Prompt" }, - "failure_message": { + "description": { "anyOf": [ { "type": "string" @@ -6533,156 +6458,133 @@ "type": "null" } ], - "title": "Failure Message" - }, - "id": { - "title": "Id", - "type": "string" + "description": "Suggested description.", + "title": "Description" }, - "notification_recipients": { + "max_age_days": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Notification Recipients" - }, - "phase": { - "title": "Phase", - "type": "string" + "description": "Always null. Age-based compaction is retired \u2014 the assistant never suggests it. Kept so an SDK generated before the change still validates this response.", + "title": "Max Age Days" }, - "progress_current": { - "title": "Progress Current", - "type": "integer" - }, - "progress_message": { + "max_size_tokens": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "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" + "description": "Max size in tokens.", + "title": "Max Size Tokens" }, - "started_at": { + "max_turns": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Started At" + "description": "Max conversation turns.", + "title": "Max Turns" }, - "status": { - "title": "Status", + "mode": { + "description": "Memory bank mode.", + "title": "Mode", "type": "string" }, - "target_dimensions": { - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "title": "Target Embedding Model", + "name": { + "description": "Suggested name.", + "title": "Name", "type": "string" }, - "task_execution_id": { + "retention_days": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Task Execution Id" + "description": "Retention in days.", + "title": "Retention Days" }, - "updated_at": { - "title": "Updated At", + "type": { + "description": "Memory bank type: conversation or general.", + "title": "Type", "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" + "name", + "type", + "mode" ], - "title": "SourceEmbeddingMigrationResponse", + "title": "MemoryBankConfigResponse", "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" + "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": "SourceIndexMode", - "type": "string" + "title": "MemoryBankListResponseModel", + "type": "object" }, - "SourceResponse": { - "description": "Response model for source data.", + "MemoryBankResponseModel": { + "description": "Response model for a single memory bank.", "properties": { - "account_id": { - "description": "Account ID associated with the source.", - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "avg_episodes_per_month": { + "chunk_overlap": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "description": "Average number of episodes per month.", - "title": "Avg Episodes Per Month" + "description": "Character overlap between chunks.", + "title": "Chunk Overlap" }, - "avg_words_per_episode": { + "chunk_size": { "anyOf": [ { "type": "integer" @@ -6691,10 +6593,10 @@ "type": "null" } ], - "description": "Average number of words per episode.", - "title": "Avg Words Per Episode" + "description": "Characters per chunk.", + "title": "Chunk Size" }, - "chunk_language": { + "compaction_prompt": { "anyOf": [ { "type": "string" @@ -6703,34 +6605,39 @@ "type": "null" } ], - "description": "Language used for chunking content.", - "title": "Chunk Language" + "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" }, - "chunk_overlap": { + "created_at": { + "description": "ISO-8601 creation timestamp.", + "title": "Created At", + "type": "string" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" + "description": "Optional description of the memory bank's purpose.", + "title": "Description" }, - "chunk_regex_separators": { + "dimensions": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "description": "Indicates if chunk separators are regex patterns.", - "title": "Chunk Regex Separators" + "description": "Vector embedding dimensions.", + "title": "Dimensions" }, - "chunk_separators": { + "embedding_model": { "anyOf": [ { "type": "string" @@ -6739,10 +6646,15 @@ "type": "null" } ], - "description": "Chunk separators used for content processing.", - "title": "Chunk Separators" + "description": "Embedding model identifier.", + "title": "Embedding Model" }, - "chunk_size": { + "id": { + "description": "Unique memory bank identifier.", + "title": "Id", + "type": "string" + }, + "max_age_days": { "anyOf": [ { "type": "integer" @@ -6751,26 +6663,10 @@ "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" + "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai-Version 2026-08-03 or later; older clients keep reading whatever value was stored.", + "title": "Max Age Days" }, - "dimensions": { + "max_size_tokens": { "anyOf": [ { "type": "integer" @@ -6779,129 +6675,289 @@ "type": "null" } ], - "description": "Dimensions of the embedding model.", - "title": "Dimensions" + "description": "Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", + "title": "Max Size Tokens" }, - "embedding_model": { + "max_turns": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Embedding model used for the source connection.", - "title": "Embedding Model" + "description": "Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", + "title": "Max Turns" }, - "embedding_model_type": { + "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": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Type of the embedding model.", - "title": "Embedding Model Type" + "description": "Content retention period in days (null = indefinite).", + "title": "Retention Days" }, - "free_retention_days": { + "source_connection_id": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Number of days content is stored for free before billing applies.", - "title": "Free Retention Days" + "description": "Linked content source ID (null if not yet provisioned).", + "title": "Source Connection Id" }, - "has_historical_data": { + "strip_quoted_reply_chains": { "default": false, - "description": "Indicates if the source connection has historical data.", - "title": "Has Historical Data", + "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", + "title": "Strip Quoted Reply Chains", "type": "boolean" }, - "id": { - "description": "Unique identifier for the source connection.", - "title": "Id", + "type": { + "description": "Bank type: conversation (chat-turn with speaker) or general (flat entries).", + "title": "Type", "type": "string" }, - "index_mode": { + "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": [ { - "$ref": "#/components/schemas/SourceIndexMode" + "type": "number" }, { "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" + "title": "Input Credits Per 1000 Tokens" }, - "name": { - "description": "Name of the source connection.", - "title": "Name", + "modality": { + "title": "Modality", "type": "string" }, - "next_poll_at": { + "output_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Timestamp for the next scheduled poll.", - "title": "Next Poll At" + "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" }, - "polling": { + "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": { + "effort": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string" + }, + "type": "object" }, { "type": "null" } ], - "description": "Polling configuration for the source connection.", - "title": "Polling" + "description": "Reasoning effort per model id, each one of that model's `effort_options` values. Not combinable with `json_template`.", + "title": "Effort" }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "evaluation_complexity": { + "default": "medium", + "description": "simple, medium, or complex", + "enum": [ + "simple", + "medium", + "complex" ], - "description": "Polling action for the source connection.", - "title": "Polling Action" + "title": "Evaluation Complexity", + "type": "string" }, - "polling_max_items": { + "evaluation_mode": { + "default": "manual", + "description": "manual or prompt", + "enum": [ + "manual", + "prompt" + ], + "title": "Evaluation Mode", + "type": "string" + }, + "evaluator_model_id": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Maximum items to poll for the source connection.", - "title": "Polling Max Items" + "description": "Evaluator model ID when evaluation_mode is prompt.", + "title": "Evaluator Model Id" }, - "pulled_at": { + "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" @@ -6910,139 +6966,86 @@ "type": "null" } ], - "description": "Timestamp when content was last pulled.", - "title": "Pulled At" + "description": "Optional JSON template for advanced mode.", + "title": "Json Template" }, - "readonly": { - "default": false, - "description": "Indicates if the source connection is read-only.", - "title": "Readonly", - "type": "boolean" + "model_ids": { + "description": "Selected model IDs (1-10).", + "items": { + "type": "string" + }, + "maxItems": 10, + "minItems": 1, + "title": "Model Ids", + "type": "array" }, - "retention": { + "prompt": { + "description": "Prompt text for the experiment.", + "title": "Prompt", + "type": "string" + }, + "selected_step_output": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Retention period for the source connection.", - "title": "Retention" + "description": "Optional step output text for evaluator context.", + "title": "Selected Step Output" }, - "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", + "system_prompt": { + "default": "", + "description": "Optional system prompt.", + "title": "System Prompt", "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" + "model_ids", + "prompt" ], - "title": "SourceResponse", + "title": "PlaygroundCreateRequest", "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).", + "PromptModelAutoUpgradeStrategy": { + "enum": [ + "none", + "early_adopter", + "middle_of_road", + "cautious_adopter" + ], + "title": "PromptModelAutoUpgradeStrategy", + "type": "string" + }, + "PromptToolResponse": { + "description": "Response model for a prompt tool.", "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": { + "description": { "anyOf": [ { - "maxLength": 2000, "type": "string" }, { "type": "null" } ], - "description": "Direction for the LLM to generate sample entries.", - "title": "Generate Direction" + "title": "Description" }, - "sample_entries": { + "documentation_url": { "anyOf": [ { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" + "type": "string" }, { "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": { + "title": "Documentation Url" + }, + "example": { "anyOf": [ { "type": "string" @@ -7051,35 +7054,42 @@ "type": "null" } ], - "description": "Language-specific chunking language code", - "title": "Chunk Language" + "title": "Example" }, - "chunk_overlap": { + "headers": { "anyOf": [ { - "minimum": 0.0, - "type": "integer" + "additionalProperties": { + "type": "string" + }, + "type": "object" }, { "type": "null" } ], - "description": "Override chunk overlap (characters)", - "title": "Chunk Overlap" + "title": "Headers" }, - "chunk_regex_separators": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "notes": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "description": "Whether chunk separators are regex patterns", - "title": "Chunk Regex Separators" + "title": "Notes" }, - "chunk_separators": { + "tool_name": { "anyOf": [ { "type": "string" @@ -7088,60 +7098,110 @@ "type": "null" } ], - "description": "Custom chunk separators (JSON-encoded list)", - "title": "Chunk Separators" + "title": "Tool Name" }, - "chunk_size": { + "tool_type": { + "title": "Tool Type", + "type": "string" + }, + "tool_type_pattern": { "anyOf": [ { - "exclusiveMinimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Override chunk size (characters per chunk)", - "title": "Chunk Size" + "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" }, - "notification_recipients": { + "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": [ { - "items": { - "type": "string" - }, - "type": "array" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Optional notification recipient emails", - "title": "Notification Recipients" - }, - "target_dimensions": { - "description": "Target embedding dimensions", - "exclusiveMinimum": 0.0, - "title": "Target Dimensions", - "type": "integer" + "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" }, - "target_embedding_model": { - "description": "Target embedding model enum", - "title": "Target Embedding Model", + "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": [ - "target_embedding_model", - "target_dimensions" + "action_type", + "description", + "params" ], - "title": "StartSourceEmbeddingMigrationRequest", + "title": "ProposedPolicyActionResponse", "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.", + "RemoveEmailDomainResponse": { "properties": { - "compaction_prompt": { + "cleanup_note": { "anyOf": [ { "type": "string" @@ -7150,55 +7210,56 @@ "type": "null" } ], - "description": "Compaction prompt to test. Falls back to the bank's current prompt when omitted.", - "title": "Compaction Prompt" + "title": "Cleanup Note" }, - "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" + "removed": { + "default": true, + "title": "Removed", + "type": "boolean" + } + }, + "title": "RemoveEmailDomainResponse", + "type": "object" + }, + "RerankerModelListResponse": { + "description": "Legacy (header-less) response shape for the reranker catalog.", + "properties": { + "default_model_type": { + "description": "Reranker used when a knowledge base does not choose one", + "title": "Default Model Type", + "type": "string" }, - "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" + "models": { + "description": "Available reranker models", + "items": { + "$ref": "#/components/schemas/RerankerModelResponse" + }, + "title": "Models", + "type": "array" }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" + "search_processing_credits": { + "description": "Credits charged for processing a search request", + "title": "Search Processing Credits", + "type": "number" } }, - "title": "TestCompactionRequest", + "required": [ + "models", + "default_model_type", + "search_processing_credits" + ], + "title": "RerankerModelListResponse", "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.", + "RerankerModelResponse": { + "description": "Information about a reranker model.", "properties": { - "agent_input": { + "credits_per_action": { + "description": "Credits charged per rerank action", + "title": "Credits Per Action", + "type": "number" + }, + "description": { "anyOf": [ { "type": "string" @@ -7207,23 +7268,43 @@ "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" + "description": "Model description", + "title": "Description" }, - "agent_step_run_id": { + "is_default": { + "description": "Whether this is the platform default reranker", + "title": "Is Default", + "type": "boolean" + }, + "is_new": { + "default": false, + "description": "Whether the model is newly released", + "title": "Is New", + "type": "boolean" + }, + "max_input_tokens": { "anyOf": [ { - "format": "uuid", - "type": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Load step output from this completed step run instead of supplying text.", - "title": "Agent Step Run Id" + "description": "Max input tokens per request", + "title": "Max Input Tokens" }, - "evaluation_prompt": { + "model_type": { + "description": "Full model type identifier. This is the value to send as reranker_model on a knowledge base; send \"none\" or an empty string to disable reranking.", + "title": "Model Type", + "type": "string" + }, + "name": { + "description": "Human-readable model name", + "title": "Name", + "type": "string" + }, + "provider": { "anyOf": [ { "type": "string" @@ -7232,211 +7313,209 @@ "type": "null" } ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] + "description": "Model provider identifier", + "title": "Provider" }, - "expectation_config": { + "supported_languages": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" + "description": "Supported languages", + "title": "Supported Languages" }, - "step_output": { + "url": { "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" + "description": "Model documentation URL", + "title": "Url" } }, - "title": "TestDraftEvaluationRequest", + "required": [ + "model_type", + "name", + "credits_per_action", + "is_default" + ], + "title": "RerankerModelResponse", "type": "object" }, - "TestDraftEvaluationResponse": { - "description": "Response for an ephemeral evaluation test.", + "ResumeInboundResponse": { "properties": { - "explanation": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Explanation" - }, - "passed": { - "title": "Passed", + "resumed": { + "title": "Resumed", "type": "boolean" - }, - "score": { - "title": "Score", - "type": "number" } }, "required": [ - "score", - "passed", - "explanation" + "resumed" ], - "title": "TestDraftEvaluationResponse", + "title": "ResumeInboundResponse", "type": "object" }, - "UnlinkResourcesRequest": { + "SendTestEmailResponse": { "properties": { - "ids": { - "description": "Resource IDs to unlink", - "items": { - "format": "uuid", - "type": "string" + "sent": { + "default": true, + "title": "Sent", + "type": "boolean" + } + }, + "title": "SendTestEmailResponse", + "type": "object" + }, + "ServiceUnavailableError": { + "properties": { + "error": { + "properties": { + "code": { + "enum": [ + "database_unavailable", + "vector_store_unavailable" + ], + "type": "string" + }, + "message": { + "type": "string" + } }, - "minItems": 1, - "title": "Ids", - "type": "array" + "required": [ + "code", + "message" + ], + "type": "object" } }, "required": [ - "ids" + "error" ], - "title": "UnlinkResourcesRequest", + "title": "ServiceUnavailableError", "type": "object" }, - "UnreadCountResponse": { + "SetAutoBlockModeRequest": { + "description": "Set the account's governance auto-block mode (shared REST request).", "properties": { - "count": { - "title": "Count", - "type": "integer" + "mode": { + "title": "Mode", + "type": "string" } }, "required": [ - "count" + "mode" ], - "title": "UnreadCountResponse", + "title": "SetAutoBlockModeRequest", "type": "object" }, - "UpdateAgentDefinitionRequest": { + "SolutionSourceConnectionResponse": { "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" + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "expected_change_id": { - "description": "The change_id from the last GET, for optimistic locking.", - "title": "Expected Change Id", + "name": { + "title": "Name", "type": "string" } }, "required": [ - "expected_change_id", - "definition" + "id", + "name" ], - "title": "UpdateAgentDefinitionRequest", + "title": "SolutionSourceConnectionResponse", "type": "object" }, - "UpdateAlertConfigRequest": { + "SolutionSummaryResponse": { + "description": "Response model for solution summary.", "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" + "agent_count": { + "description": "Number of linked agents.", + "title": "Agent Count", + "type": "integer" }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the alert config is enabled", - "title": "Enabled" + "created_at": { + "description": "Timestamp when the solution was created.", + "title": "Created At", + "type": "string" }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" + "description": { + "description": "Description of the solution.", + "title": "Description", + "type": "string" }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" + "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" } }, - "title": "UpdateAlertConfigRequest", + "required": [ + "id", + "name", + "description", + "agent_count", + "knowledge_base_count", + "source_connection_count", + "memory_bank_count", + "created_at", + "updated_at" + ], + "title": "SolutionSummaryResponse", "type": "object" }, - "UpdateApiVersionRequest": { + "SourceConnectionResponseModel": { + "description": "Nested source connection summary within a knowledge base response.", "properties": { - "version": { + "id": { + "description": "Source connection identifier.", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Source connection name.", + "title": "Name", + "type": "string" + }, + "polling": { "anyOf": [ { "type": "string" @@ -7445,85 +7524,153 @@ "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" + "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" } }, - "title": "UpdateApiVersionRequest", + "required": [ + "id", + "name", + "url", + "source_type" + ], + "title": "SourceConnectionResponseModel", "type": "object" }, - "UpdateEvaluationCriteriaRequest": { - "description": "Request body for updating an evaluation criteria.\n\nRetry settings and sample frequency are set at the agent level.", + "SourceContentStatusListResponse": { + "description": "Response model for a paginated per-item indexing status list.", "properties": { - "description": { + "data": { + "items": { + "$ref": "#/components/schemas/SourceContentStatusResponse" + }, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "SourceContentStatusListResponse", + "type": "object" + }, + "SourceContentStatusResponse": { + "description": "Response model for one content item's indexing status.", + "properties": { + "awaiting_reindex": { + "default": false, + "description": "True when the item is linked and reports completed but its content is not yet embedded under the index the source connection currently uses, because it still sits under the index that connection used before an embedding migration switched it. Anything ingested while a migration ran can land in this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can still return it, so the item may appear in results while its body is unsearchable. It clears on its own \u2014 a reconciliation pass re-embeds the item under the current index, typically within minutes of the migration finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one 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.", + "title": "Awaiting Reindex", + "type": "boolean" + }, + "content_status": { + "description": "Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or failed.", + "title": "Content Status", + "type": "string" + }, + "content_token_count": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Description" + "description": "Extracted token count.", + "title": "Content Token Count" }, - "enabled": { + "content_type": { + "description": "Content type group: text, audio, video, image, or document.", + "title": "Content Type", + "type": "string" + }, + "content_url": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Enabled" + "description": "Internal URL identifying the item. Uploaded files use a `file-upload://` URL.", + "title": "Content Url" }, - "evaluation_prompt": { + "content_version_id": { + "description": "ID of the content version. This is the `content_version_id` returned by the upload endpoints, so it is what you match an upload against.", + "title": "Content Version Id", + "type": "string" + }, + "content_word_count": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Evaluation Prompt" + "description": "Extracted word count.", + "title": "Content Word Count" }, - "evaluation_tier": { + "error": { "anyOf": [ { - "$ref": "#/components/schemas/AgentEvaluationTier" + "type": "string" }, { "type": "null" } - ] + ], + "description": "Why the item failed, when `content_status` is `failed`.", + "title": "Error" }, - "expectation_config": { + "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.", + "title": "Extracted Media Capped", + "type": "boolean" + }, + "extracted_media_count": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "title": "Expectation Config" + "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.", + "title": "Extracted Media Count" }, - "pass_threshold": { + "extracted_media_limit": { "anyOf": [ { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Pass Threshold" + "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.", + "title": "Extracted Media Limit" }, - "step_id": { + "indexed_at": { "anyOf": [ { "type": "string" @@ -7532,85 +7679,100 @@ "type": "null" } ], - "title": "Step Id" - } - }, - "title": "UpdateEvaluationCriteriaRequest", - "type": "object" - }, - "UpdateKnowledgeBaseBody": { - "description": "Request body for updating a knowledge base.", - "properties": { - "default_score_threshold": { + "description": "Timestamp when the item finished indexing and became retrievable. `null` until then.", + "title": "Indexed At" + }, + "mime_type": { "anyOf": [ { - "maximum": 1.0, - "minimum": -1.0, - "type": "number" + "type": "string" }, { "type": "null" } ], - "description": "Default score threshold (-1 to clear).", - "title": "Default Score Threshold" + "description": "MIME type the item was ingested as, when known.", + "title": "Mime Type" }, - "default_top_k": { + "published_at": { "anyOf": [ { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Default reranked results (0 to clear).", - "title": "Default Top K" + "description": "Publication timestamp of the item, when known.", + "title": "Published At" }, - "default_top_n": { + "pulled_at": { + "description": "Timestamp when the item was uploaded or pulled.", + "title": "Pulled At", + "type": "string" + }, + "source_connection_content_version_id": { "anyOf": [ { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Default results (0 to clear).", - "title": "Default Top N" + "description": "ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing \u2014 an item that is still processing, or that failed, has no retrievable content and keeps this `null`.", + "title": "Source Connection Content Version Id" }, - "description": { + "title": { "anyOf": [ { - "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "description": "New description.", - "title": "Description" - }, - "name": { + "description": "Title of the content item.", + "title": "Title" + } + }, + "required": [ + "content_version_id", + "source_connection_content_version_id", + "title", + "content_url", + "content_type", + "mime_type", + "content_status", + "error", + "content_word_count", + "content_token_count", + "pulled_at", + "published_at", + "indexed_at" + ], + "title": "SourceContentStatusResponse", + "type": "object" + }, + "SourceEmbeddingMigrationResponse": { + "description": "Response model for source embedding migration status.", + "properties": { + "completed_at": { "anyOf": [ { - "maxLength": 255, - "minLength": 1, "type": "string" }, { "type": "null" } ], - "description": "New name.", - "title": "Name" + "title": "Completed At" }, - "reranker_model": { + "created_at": { + "title": "Created At", + "type": "string" + }, + "failure_message": { "anyOf": [ { "type": "string" @@ -7619,10 +7781,13 @@ "type": "null" } ], - "description": "Reranker model (empty string for no reranking).", - "title": "Reranker Model" + "title": "Failure Message" }, - "source_ids": { + "id": { + "title": "Id", + "type": "string" + }, + "notification_recipients": { "anyOf": [ { "items": { @@ -7634,17 +7799,17 @@ "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": { + "title": "Notification Recipients" + }, + "phase": { + "title": "Phase", + "type": "string" + }, + "progress_current": { + "title": "Progress Current", + "type": "integer" + }, + "progress_message": { "anyOf": [ { "type": "string" @@ -7653,108 +7818,167 @@ "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" + "title": "Progress Message" }, - "description": { + "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": [ { - "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "description": "Optional description. Send empty string \"\" to clear.", - "title": "Description" + "title": "Started At" }, - "max_age_days": { + "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": [ { - "minimum": 0.0, - "type": "integer" + "type": "string" }, { "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" + "title": "Task Execution Id" }, - "max_size_tokens": { + "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": [ { - "minimum": 0.0, - "type": "integer" + "type": "number" }, { "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" + "description": "Average number of episodes per month.", + "title": "Avg Episodes Per Month" }, - "max_turns": { + "avg_words_per_episode": { "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" + "description": "Average number of words per episode.", + "title": "Avg Words Per Episode" }, - "name": { + "chunk_language": { "anyOf": [ { - "maxLength": 255, - "minLength": 1, "type": "string" }, { "type": "null" } ], - "description": "New name.", - "title": "Name" + "description": "Language used for chunking content.", + "title": "Chunk Language" }, - "retention_days": { + "chunk_overlap": { "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": { + "description": "Chunk overlap for content processing.", + "title": "Chunk Overlap" + }, + "chunk_regex_separators": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "description": "Description of the solution", - "title": "Description" + "description": "Indicates if chunk separators are regex patterns.", + "title": "Chunk Regex Separators" }, - "name": { + "chunk_separators": { "anyOf": [ { "type": "string" @@ -7763,46 +7987,50 @@ "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": { + "description": "Chunk separators used for content processing.", + "title": "Chunk Separators" + }, + "chunk_size": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "integer" }, { "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" + "description": "Chunk size for content processing.", + "title": "Chunk Size" }, - "name": { + "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": [ { - "maxLength": 255, - "minLength": 1, - "type": "string" + "type": "integer" }, { "type": "null" } ], - "description": "New name.", - "title": "Name" + "description": "Dimensions of the embedding model.", + "title": "Dimensions" }, - "polling": { + "embedding_model": { "anyOf": [ { "type": "string" @@ -7811,154 +8039,69 @@ "type": "null" } ], - "description": "New polling interval.", - "title": "Polling" + "description": "Embedding model used for the source connection.", + "title": "Embedding Model" }, - "retention_days": { + "embedding_model_type": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "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" + "description": "Type of the embedding model.", + "title": "Embedding Model Type" }, - "error": { + "free_retention_days": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Error message if status is failed.", - "title": "Error" + "description": "Number of days content is stored for free before billing applies.", + "title": "Free Retention Days" }, - "file_size": { - "description": "Size in bytes.", - "title": "File Size", - "type": "integer" - }, - "filename": { - "description": "Original filename.", - "title": "Filename", - "type": "string" + "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 upload.", + "description": "Unique identifier for the source connection.", "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" + "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." }, - "options": { + "media_types": { + "description": "Media kinds extracted from indexed content and embedded as multi-modal KB chunks (subset of ['images', 'video']). Empty = text-only.", "items": { - "$ref": "#/components/schemas/VariantOptionResponse" + "type": "string" }, - "title": "Options", + "title": "Media Types", "type": "array" }, - "title": { - "title": "Title", + "name": { + "description": "Name of the source connection.", + "title": "Name", "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": { + "next_poll_at": { "anyOf": [ { "type": "string" @@ -7967,144 +8110,187 @@ "type": "null" } ], - "title": "Description" + "description": "Timestamp for the next scheduled poll.", + "title": "Next Poll At" }, - "input_1h_cache_write_credits_per_1000_tokens": { + "polling": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input 1H Cache Write Credits Per 1000 Tokens" + "description": "Polling configuration for the source connection.", + "title": "Polling" }, - "input_5m_cache_write_credits_per_1000_tokens": { + "polling_action": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input 5M Cache Write Credits Per 1000 Tokens" + "description": "Polling action for the source connection.", + "title": "Polling Action" }, - "input_cache_hit_credits_per_1000_tokens": { + "polling_max_items": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Input Cache Hit Credits Per 1000 Tokens" + "description": "Maximum items to poll for the source connection.", + "title": "Polling Max Items" }, - "input_credits_per_1000_tokens": { + "pulled_at": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input Credits Per 1000 Tokens" + "description": "Timestamp when content was last pulled.", + "title": "Pulled At" }, - "long_context_input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" + "readonly": { + "default": false, + "description": "Indicates if the source connection is read-only.", + "title": "Readonly", + "type": "boolean" }, - "long_context_input_credits_per_1000_tokens": { + "retention": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Long Context Input Credits Per 1000 Tokens" + "description": "Retention period for the source connection.", + "title": "Retention" }, - "long_context_output_credits_per_1000_tokens": { + "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": "number" + "type": "string" }, { "type": "null" } ], - "title": "Long Context Output Credits Per 1000 Tokens" + "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" }, - "long_context_threshold": { + "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": [ { - "type": "integer" + "maxLength": 2000, + "type": "string" }, { "type": "null" } ], - "title": "Long Context Threshold" + "description": "Direction for the LLM to generate sample entries.", + "title": "Generate Direction" }, - "output_credits_per_1000_tokens": { + "sample_entries": { "anyOf": [ { - "type": "number" + "items": { + "type": "string" + }, + "maxItems": 20, + "minItems": 1, + "type": "array" }, { "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" + "description": "Explicit sample entries to compact.", + "title": "Sample Entries" } }, "required": [ - "agent_definition" + "compaction_prompt" ], - "title": "AgentImportPreviewRequest", + "title": "StandaloneTestCompactionRequest", "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).", + "StartSourceEmbeddingMigrationRequest": { + "description": "Request payload to start a source embedding migration.", "properties": { - "agent_name": { + "chunk_language": { "anyOf": [ { "type": "string" @@ -8113,143 +8299,35 @@ "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": "Language-specific chunking language code", + "title": "Chunk Language" }, - "description": { + "chunk_overlap": { "anyOf": [ { - "type": "string" + "minimum": 0.0, + "type": "integer" }, { "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" + "description": "Override chunk overlap (characters)", + "title": "Chunk Overlap" }, - "payload_export_version": { + "chunk_regex_separators": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "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" + "description": "Whether chunk separators are regex patterns", + "title": "Chunk Regex Separators" }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentRunListResponse", - "type": "object" - }, - "routers__api__agents__AgentTraceSearchRequest": { - "properties": { - "agent_id": { + "chunk_separators": { "anyOf": [ { "type": "string" @@ -8258,134 +8336,117 @@ "type": "null" } ], - "description": "Filter by agent ID.", - "title": "Agent Id" - }, - "query": { - "description": "Search query text.", - "title": "Query", - "type": "string" + "description": "Custom chunk separators (JSON-encoded list)", + "title": "Chunk Separators" }, - "run_status": { + "chunk_size": { "anyOf": [ { - "type": "string" + "exclusiveMinimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "description": "Filter by run status.", - "title": "Run Status" + "description": "Override chunk size (characters per chunk)", + "title": "Chunk Size" }, - "step_type": { + "notification_recipients": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "description": "Filter by step type.", - "title": "Step Type" + "description": "Optional notification recipient emails", + "title": "Notification Recipients" }, - "top_n": { - "default": 10, - "description": "Maximum number of results.", - "maximum": 100.0, - "minimum": 1.0, - "title": "Top N", + "target_dimensions": { + "description": "Target embedding dimensions", + "exclusiveMinimum": 0.0, + "title": "Target Dimensions", "type": "integer" + }, + "target_embedding_model": { + "description": "Target embedding model \u2014 a `model_type` from `GET /models/embedders`, which also reports the `dimensions` each embedder supports and the modalities it can index.", + "title": "Target Embedding Model", + "type": "string" } }, "required": [ - "query" + "target_embedding_model", + "target_dimensions" ], - "title": "AgentTraceSearchRequest", + "title": "StartSourceEmbeddingMigrationRequest", "type": "object" }, - "routers__api__agents__CreateAgentRequest": { + "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": { - "agent_definition": { + "compaction_prompt": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "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" + "description": "Compaction prompt to test. Falls back to the bank's current prompt when omitted.", + "title": "Compaction Prompt" }, - "agent_template": { + "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": "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": "Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction').", + "title": "Generate Direction" }, - "description": { + "sample_entries": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "maxItems": 20, + "minItems": 1, + "type": "array" }, { "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" + "description": "Explicit sample entries to compact.", + "title": "Sample Entries" } }, - "required": [ - "name" - ], - "title": "CreateAgentRequest", + "title": "TestCompactionRequest", "type": "object" }, - "routers__api__agents__GovernancePolicyRefResponse": { - "description": "Reference to a governance policy by id and name.", + "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": { - "policy_id": { - "description": "Governance policy identifier.", - "title": "Policy Id", - "type": "string" - }, - "policy_name": { + "agent_input": { "anyOf": [ { "type": "string" @@ -8394,115 +8455,178 @@ "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": { + "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": [ { - "maxLength": 32, + "format": "uuid", "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" + "description": "Load step output from this completed step run instead of supplying text.", + "title": "Agent Step Run Id" }, - "allowed_senders": { + "evaluation_prompt": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "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" + "title": "Evaluation Prompt" }, - "ignore_auto_generated": { + "evaluation_tier": { "anyOf": [ { - "type": "boolean" + "$ref": "#/components/schemas/AgentEvaluationTier" }, { "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": { + "expectation_config": { "anyOf": [ { - "type": "boolean" + "additionalProperties": true, + "type": "object" }, { "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" + "title": "Expectation Config" }, - "require_sender_auth": { + "pass_threshold": { + "default": 0.5, + "maximum": 1.0, + "minimum": 0.0, + "title": "Pass Threshold", + "type": "number" + }, + "step_output": { "anyOf": [ { - "type": "boolean" + "minLength": 1, + "type": "string" }, { "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" + "description": "The step output text to evaluate. Omit if agent_step_run_id is supplied.", + "title": "Step Output" } }, - "title": "SetEmailTriggerConfigRequest", + "title": "TestDraftEvaluationRequest", "type": "object" }, - "routers__api__agents__UpdateAgentRequest": { + "TestDraftEvaluationResponse": { + "description": "Response for an ephemeral evaluation test.", "properties": { - "agent_definition": { + "explanation": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "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" + "title": "Explanation" }, - "default_evaluation_tier": { + "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": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Default evaluation tier: 'fast', 'balanced', or 'thorough'.", - "title": "Default Evaluation Tier" + "description": "Cooldown period in minutes", + "title": "Cooldown Minutes" }, - "description": { + "distribution_type": { "anyOf": [ { "type": "string" @@ -8511,49 +8635,56 @@ "type": "null" } ], - "description": "New description for the agent.", - "title": "Description" + "description": "Distribution type", + "title": "Distribution Type" }, - "entity_remap": { + "enabled": { "anyOf": [ { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "type": "boolean" }, { "type": "null" } ], - "description": "Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents).", - "title": "Entity Remap" + "description": "Whether the alert config is enabled", + "title": "Enabled" }, - "evaluation_mode": { + "recipient_user_ids": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", - "title": "Evaluation Mode" + "description": "User IDs for selected_members distribution", + "title": "Recipient User Ids" }, - "max_retries": { + "threshold": { "anyOf": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "description": "Max retries for eval_and_retry mode (1-10).", - "title": "Max Retries" - }, - "name": { + "description": "Threshold configuration", + "title": "Threshold" + } + }, + "title": "UpdateAlertConfigRequest", + "type": "object" + }, + "UpdateApiVersionRequest": { + "properties": { + "version": { "anyOf": [ { "type": "string" @@ -8562,60 +8693,60 @@ "type": "null" } ], - "description": "New name for the agent.", - "title": "Name" - }, - "prompt_model_auto_rollback_enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { + "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" } ], - "description": "Enable or disable automatic rollback for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled" + "title": "Description" }, - "prompt_model_auto_rollback_triggers": { + "enabled": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "boolean" }, { "type": "null" } ], - "description": "Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed.", - "title": "Prompt Model Auto Rollback Triggers" + "title": "Enabled" }, - "prompt_model_auto_upgrade_strategy": { + "evaluation_prompt": { "anyOf": [ { - "$ref": "#/components/schemas/PromptModelAutoUpgradeStrategy" + "type": "string" }, { "type": "null" } ], - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter." + "title": "Evaluation Prompt" }, - "retry_on_failure": { + "evaluation_tier": { "anyOf": [ { - "type": "boolean" + "$ref": "#/components/schemas/AgentEvaluationTier" }, { "type": "null" } - ], - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure" + ] }, - "sampling_config": { + "expectation_config": { "anyOf": [ { "additionalProperties": true, @@ -8625,137 +8756,143 @@ "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" + "title": "Expectation Config" }, - "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" + "pass_threshold": { + "anyOf": [ + { + "maximum": 1.0, + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Pass Threshold" }, - "set_sampling_config": { - "default": false, - "description": "When true and sampling_config is omitted, clears the config to null.", - "title": "Set Sampling Config", - "type": "boolean" + "step_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Step Id" } }, - "title": "UpdateAgentRequest", + "title": "UpdateEvaluationCriteriaRequest", "type": "object" }, - "routers__api__ai_assistant__AiAssistantFeedbackRequest": { - "description": "Request body for submitting AI assistant feedback.", + "UpdateKnowledgeBaseBody": { + "description": "Request body for updating a knowledge base.", "properties": { - "agent_conversation_id": { + "default_score_threshold": { "anyOf": [ { - "format": "uuid", - "type": "string" + "maximum": 1.0, + "minimum": -1.0, + "type": "number" }, { "type": "null" } ], - "description": "Agent conversation ID, if applicable.", - "title": "Agent Conversation Id" + "description": "Prefilled into Minimum Rerank Score on a new retrieval step (-1 to clear).", + "title": "Default Score Threshold" }, - "comment": { + "default_top_k": { "anyOf": [ { - "type": "string" + "maximum": 200.0, + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "description": "Optional comment.", - "title": "Comment" + "description": "Prefilled into Top K on a new retrieval step (0 to clear).", + "title": "Default Top K" }, - "context": { + "default_top_n": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "maximum": 200.0, + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "description": "Additional context.", - "title": "Context" + "description": "Prefilled into Top N on a new retrieval step (0 to clear).", + "title": "Default Top N" }, - "conversation_id": { + "description": { "anyOf": [ { - "format": "uuid", + "maxLength": 1000, "type": "string" }, { "type": "null" } ], - "description": "Conversation ID for the interaction.", - "title": "Conversation Id" + "description": "New description.", + "title": "Description" }, - "feature": { - "description": "Feature name (e.g. 'source', 'solution').", - "title": "Feature", - "type": "string" + "name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New name.", + "title": "Name" }, - "prompt_call_id": { + "reranker_model": { "anyOf": [ { - "format": "uuid", "type": "string" }, { "type": "null" } ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" + "description": "New reranker model \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the current reranker in place \u2014 it does NOT turn it off. \"\" is accepted as a synonym for \"none\", but prefer \"none\": an empty string does not survive every client's serialization.", + "title": "Reranker Model" }, - "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" + "source_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "New list of source connection IDs.", + "title": "Source Ids" } }, - "required": [ - "body" - ], - "title": "AddCommentRequest", + "title": "UpdateKnowledgeBaseBody", "type": "object" }, - "routers__api__alerts__AlertCommentResponse": { + "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": { - "body": { - "title": "Body", - "type": "string" - }, - "created_at": { + "compaction_prompt": { "anyOf": [ { "type": "string" @@ -8764,153 +8901,107 @@ "type": "null" } ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" + "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" }, - "user_name": { + "description": { "anyOf": [ { + "maxLength": 1000, "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" + "description": "Optional description. Send empty string \"\" to clear.", + "title": "Description" }, - "history": { - "items": { - "$ref": "#/components/schemas/AlertHistoryEntryResponse" - }, - "title": "History", - "type": "array" + "max_age_days": { + "anyOf": [ + { + "minimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert for older clients.", + "title": "Max Age Days" }, - "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": { + "max_size_tokens": { "anyOf": [ { - "type": "string" + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Agent Id" + "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" }, - "agent_run_id": { + "max_turns": { "anyOf": [ { - "type": "string" + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Agent Run Id" + "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" }, - "alert_config_id": { + "name": { "anyOf": [ { + "maxLength": 255, + "minLength": 1, "type": "string" }, { "type": "null" } ], - "title": "Alert Config Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "comment_count": { - "title": "Comment Count", - "type": "integer" + "description": "New name.", + "title": "Name" }, - "created_at": { + "retention_days": { "anyOf": [ { - "type": "string" + "minimum": 0.0, + "type": "integer" }, { "type": "null" } ], - "title": "Created At" + "description": "Content source retention in days. Send 0 to clear (indefinite).", + "title": "Retention Days" }, + "strip_quoted_reply_chains": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", + "title": "Strip Quoted Reply Chains" + } + }, + "title": "UpdateMemoryBankBody", + "type": "object" + }, + "UpdateSolutionRequest": { + "description": "Request model for updating a solution", + "properties": { "description": { "anyOf": [ { @@ -8920,20 +9011,10 @@ "type": "null" } ], + "description": "Description of the solution", "title": "Description" }, - "details": { - "title": "Details" - }, - "id": { - "title": "Id", - "type": "string" - }, - "is_subscribed": { - "title": "Is Subscribed", - "type": "boolean" - }, - "mcp_client_id": { + "name": { "anyOf": [ { "type": "string" @@ -8942,20 +9023,46 @@ "type": "null" } ], - "title": "Mcp Client Id" + "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 (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. [] disables media extraction (text-only).", + "title": "Media Types" }, - "source_connection_id": { + "name": { "anyOf": [ { + "maxLength": 255, + "minLength": 1, "type": "string" }, { "type": "null" } ], - "title": "Source Connection Id" + "description": "New name.", + "title": "Name" }, - "source_connection_pull_id": { + "polling": { "anyOf": [ { "type": "string" @@ -8964,57 +9071,33 @@ "type": "null" } ], - "title": "Source Connection Pull Id" - }, - "status": { - "title": "Status", - "type": "string" - }, - "subscriber_count": { - "title": "Subscriber Count", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" + "description": "New polling interval.", + "title": "Polling" }, - "updated_at": { + "retention_days": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Updated At" + "description": "New retention period in days \u2014 content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged.", + "title": "Retention Days" } }, - "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", + "title": "UpdateSourceBody", "type": "object" }, - "routers__api__alerts__AlertSubscriberResponse": { + "UploadAgentInputApiResponse": { "properties": { - "created_at": { + "content_type": { + "description": "Resolved MIME type.", + "title": "Content Type", + "type": "string" + }, + "error": { "anyOf": [ { "type": "string" @@ -9023,314 +9106,280 @@ "type": "null" } ], - "title": "Created At" + "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" }, - "user_id": { - "title": "User Id", + "status": { + "description": "processing, ready, or failed.", + "title": "Status", "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" } }, "required": [ "id", - "user_id", - "user_name", - "created_at" + "status", + "filename", + "content_type", + "file_size" ], - "title": "AlertSubscriberResponse", + "title": "UploadAgentInputApiResponse", "type": "object" }, - "routers__api__alerts__OrganizationAlertPreferenceResponse": { + "ValidationError": { "properties": { - "alert_type": { - "title": "Alert Type", + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", "type": "string" }, - "is_override": { - "title": "Is Override", - "type": "boolean" - }, - "organization_id": { - "title": "Organization Id", + "type": { + "title": "Error Type", "type": "string" - }, - "subscribed": { - "title": "Subscribed", - "type": "boolean" } }, "required": [ - "organization_id", - "alert_type", - "subscribed", - "is_override" + "loc", + "msg", + "type" ], - "title": "OrganizationAlertPreferenceResponse", + "title": "ValidationError", "type": "object" }, - "routers__api__alerts__UpdateOrganizationAlertPreferenceRequest": { + "VariantCategoryResponse": { + "description": "Response model for a variant category", "properties": { - "subscribed": { - "description": "Whether the user should receive this alert for the organization", - "title": "Subscribed", + "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": [ - "subscribed" + "category", + "title", + "description", + "configurable", + "options" ], - "title": "UpdateOrganizationAlertPreferenceRequest", + "title": "VariantCategoryResponse", "type": "object" }, - "routers__api__contents__ContentDetailResponse": { - "description": "Response model for content detail.", + "VariantOptionResponse": { + "description": "Response model for a variant option", "properties": { - "content_duration": { + "default": { + "title": "Default", + "type": "boolean" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Duration of the content in seconds.", - "title": "Content Duration" + "title": "Description" }, - "content_duration_display": { + "input_1h_cache_write_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "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" + "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", + "title": "Input 1H Cache Write Credits Per 1000 Tokens" }, - "content_word_count": { + "input_30m_cache_write_credits_per_1000_tokens": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], - "description": "Word count of the content.", - "title": "Content Word Count" + "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", + "title": "Input 30M Cache Write Credits Per 1000 Tokens" }, - "description": { + "input_5m_cache_write_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Description of the content.", - "title": "Description" + "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", + "title": "Input 5M Cache Write Credits Per 1000 Tokens" }, - "error": { + "input_cache_hit_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Error message, if any.", - "title": "Error" - }, - "id": { - "description": "Unique identifier for the content version.", - "title": "Id", - "type": "string" + "description": "Credits per 1,000 input tokens read from a prompt cache.", + "title": "Input Cache Hit Credits Per 1000 Tokens" }, - "metadata": { + "input_credits_per_1000_tokens": { "anyOf": [ { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" + "type": "number" }, { "type": "null" } ], - "description": "Metadata associated with the content.", - "title": "Metadata" + "title": "Input Credits Per 1000 Tokens" }, - "published_at": { + "long_context_input_cache_hit_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "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" + "description": "Credits per 1,000 input tokens read from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens.", + "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" }, - "text_content": { + "long_context_input_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Text content.", - "title": "Text Content" - }, - "text_content_end": { - "description": "End position of the text content.", - "title": "Text Content End", - "type": "integer" + "title": "Long Context Input Credits Per 1000 Tokens" }, - "text_content_start": { - "description": "Start position of the text content.", - "title": "Text Content Start", - "type": "integer" + "long_context_output_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Long Context Output Credits Per 1000 Tokens" }, - "text_content_total_length": { - "description": "Total length of the text content.", - "title": "Text Content Total Length", - "type": "integer" + "long_context_threshold": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Long Context Threshold" }, - "title": { + "output_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Title of the content.", - "title": "Title" + "title": "Output Credits Per 1000 Tokens" + }, + "title": { + "title": "Title", + "type": "string" + }, + "value": { + "title": "Value", + "type": "string" } }, "required": [ - "id", - "source_connection_content_version_id", - "source_connection_id", - "source_name", - "source_type", + "value", "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" + "default" ], - "title": "ContentDetailResponse", + "title": "VariantOptionResponse", "type": "object" }, - "routers__api__contents__ContentEmbeddingsListResponse": { - "description": "Response model for paginated content embeddings.", + "routers__api__agents__AgentImportPreviewRequest": { + "description": "Dry-run import request \u2014 same payload shape as the export endpoint.", "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ContentEmbeddingResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" + "agent_definition": { + "additionalProperties": true, + "description": "Payload in the same shape as GET /agents/{agent_id}/export.", + "title": "Agent Definition", + "type": "object" } }, "required": [ - "data", - "pagination" + "agent_definition" ], - "title": "ContentEmbeddingsListResponse", + "title": "AgentImportPreviewRequest", "type": "object" }, - "routers__api__contents__FileUploadResponse": { - "description": "Response model for content file replacement upload.", + "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": { - "content_version_id": { + "agent_name": { "anyOf": [ { "type": "string" @@ -9339,15 +9388,15 @@ "type": "null" } ], - "description": "ID of the content version being replaced", - "title": "Content Version Id" + "description": "Imported agent name, if any.", + "title": "Agent Name" }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" + "alert_configs": { + "description": "Number of alert configs in the payload.", + "title": "Alert Configs", + "type": "integer" }, - "source_connection_content_version_id": { + "description": { "anyOf": [ { "type": "string" @@ -9356,72 +9405,143 @@ "type": "null" } ], - "description": "ID of the source connection content version", - "title": "Source Connection Content Version Id" + "description": "Imported agent description, if any.", + "title": "Description" }, - "status": { - "description": "Processing status", - "title": "Status", + "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": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" + "ok", + "agent_name", + "description", + "step_count", + "schedules", + "alert_configs", + "evaluation_criteria", + "governance_policies" ], - "title": "FileUploadResponse", + "title": "AgentImportPreviewResponse", "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.", + "routers__api__agents__AgentListResponse": { "properties": { - "results": { + "data": { + "description": "List of agents.", "items": { - "$ref": "#/components/schemas/DocsSearchResultResponse" + "$ref": "#/components/schemas/AgentSummaryResponse" }, - "title": "Results", + "title": "Data", "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" } }, "required": [ - "results" + "data", + "pagination" ], - "title": "DocsSearchResponse", + "title": "AgentListResponse", "type": "object" }, - "routers__api__governance__GovernanceAiAssistantRequest": { - "description": "Request body for the governance AI assistant.", + "routers__api__agents__AgentRunListResponse": { "properties": { - "user_input": { - "description": "Natural-language request for the governance AI assistant.", - "title": "User Input", - "type": "string" + "data": { + "description": "List of agent runs.", + "items": { + "$ref": "#/components/schemas/AgentRunResponse" + }, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" } }, "required": [ - "user_input" + "data", + "pagination" ], - "title": "GovernanceAiAssistantRequest", + "title": "AgentRunListResponse", "type": "object" }, - "routers__api__governance__GovernanceConversationResponse": { - "description": "A governance AI assistant conversation entry.", + "routers__api__agents__AgentTraceSearchRequest": { "properties": { - "accepted": { + "agent_id": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "description": "True if accepted, false if declined, null if pending.", - "title": "Accepted" + "description": "Filter by agent ID.", + "title": "Agent Id" }, - "ai_response": { + "query": { + "description": "Search query text.", + "title": "Query", + "type": "string" + }, + "run_status": { "anyOf": [ { "type": "string" @@ -9430,68 +9550,39 @@ "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" + "description": "Filter by run status.", + "title": "Run Status" }, - "proposed_actions": { + "step_type": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "JSON of proposed actions, or null.", - "title": "Proposed Actions" + "description": "Filter by step type.", + "title": "Step Type" }, - "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" + "top_n": { + "default": 10, + "description": "Maximum number of results.", + "maximum": 100.0, + "minimum": 1.0, + "title": "Top N", + "type": "integer" } }, "required": [ - "accepted" + "query" ], - "title": "MemoryBankAcceptRequest", + "title": "AgentTraceSearchRequest", "type": "object" }, - "routers__api__memory_banks__MemoryBankAiAssistantRequest": { - "description": "Request body for the memory bank AI assistant.", + "routers__api__agents__CreateAgentRequest": { "properties": { - "current_config": { + "agent_definition": { "anyOf": [ { "additionalProperties": true, @@ -9501,213 +9592,180 @@ "type": "null" } ], - "description": "Current configuration to refine, if any.", - "title": "Current Config" + "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" }, - "history_since": { + "agent_template": { "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" + "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" }, - "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": { + "description": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "description": "Whether the user accepted this proposal.", - "title": "Accepted" + "description": "Optional description.", + "title": "Description" }, - "ai_note": { + "entity_remap": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string" + }, + "type": "object" }, { "type": "null" } ], - "description": "AI note from this turn.", - "title": "Ai Note" + "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" }, - "conversation_id": { - "description": "Unique ID for this conversation turn.", - "title": "Conversation Id", + "name": { + "description": "Name for the new agent.", + "title": "Name", "type": "string" }, - "resulting_config": { + "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": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "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" + "description": "Display name of the policy at evaluation time. May be null when the policy has been deleted.", + "title": "Policy Name" } }, "required": [ - "user_input", - "conversation_id" + "policy_id" ], - "title": "MemoryBankConversationTurnResponse", + "title": "GovernancePolicyRefResponse", "type": "object" }, - "routers__api__memory_banks__MemoryBankLastConversationResponse": { - "description": "Response for fetching memory bank conversation history.", + "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": { - "accepted": { + "alias": { "anyOf": [ { - "type": "boolean" + "maxLength": 32, + "type": "string" }, { "type": "null" } ], - "description": "Whether the user accepted the last proposal.", - "title": "Accepted" + "description": "Custom alias, unique per account, answering as `.@agent.seclai.com` and as `@` on each verified account email domain (alphanumeric plus '+', '.', '-'; 1\u201332 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear.", + "title": "Alias" }, - "ai_note": { + "allowed_senders": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "description": "AI note from the most recent turn.", - "title": "Ai Note" - }, - "total": { - "default": 0, - "description": "Total conversation turns.", - "title": "Total", - "type": "integer" + "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" }, - "turns": { - "description": "Recent conversation turns (oldest first).", - "items": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankConversationTurnResponse" - }, - "title": "Turns", - "type": "array" + "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" }, - "user_input": { + "queue_on_quota": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "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" + "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" }, - "total": { - "title": "Total", - "type": "integer" + "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" } }, - "required": [ - "alerts", - "total" - ], - "title": "ModelAlertListResponse", + "title": "SetEmailTriggerConfigRequest", "type": "object" }, - "routers__api__model_lifecycle__ModelAlertResponse": { + "routers__api__agents__UpdateAgentRequest": { "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { + "agent_definition": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "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" + "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" }, - "read_at": { + "default_evaluation_tier": { "anyOf": [ { "type": "string" @@ -9716,9 +9774,10 @@ "type": "null" } ], - "title": "Read At" + "description": "Default evaluation tier: 'fast', 'balanced', or 'thorough'.", + "title": "Default Evaluation Tier" }, - "successor_model_name": { + "description": { "anyOf": [ { "type": "string" @@ -9727,42 +9786,25 @@ "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": { + "description": "New description for the agent.", + "title": "Description" + }, + "entity_remap": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string" + }, + "type": "object" }, { "type": "null" } ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" + "description": "Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents).", + "title": "Entity Remap" }, - "family": { + "evaluation_mode": { "anyOf": [ { "type": "string" @@ -9771,52 +9813,22 @@ "type": "null" } ], - "title": "Family" + "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", + "title": "Evaluation Mode" }, - "family_generation": { + "max_retries": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "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" + "description": "Max retries for eval_and_retry mode (1-10).", + "title": "Max Retries" }, "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" @@ -9825,185 +9837,111 @@ "type": "null" } ], - "title": "Released At" + "description": "New name for the agent.", + "title": "Name" }, - "sunset_at": { + "prompt_model_auto_rollback_enabled": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "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" + "description": "Enable or disable automatic rollback for upgraded models.", + "title": "Prompt Model Auto Rollback Enabled" }, - "current_model_name": { - "title": "Current Model Name", - "type": "string" + "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" }, - "same_provider": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Same Provider", - "type": "array" + "prompt_model_auto_upgrade_strategy": { + "anyOf": [ + { + "$ref": "#/components/schemas/PromptModelAutoUpgradeStrategy" + }, + { + "type": "null" + } + ], + "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter." }, - "successor": { + "retry_on_failure": { "anyOf": [ { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" + "type": "boolean" }, { "type": "null" } - ] + ], + "description": "Whether to retry on evaluation failure.", + "title": "Retry On Failure" }, - "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": { + "sampling_config": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Description" + "description": "Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}.", + "title": "Sampling Config" }, - "entity_type": { - "title": "Entity Type", - "type": "string" + "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" }, - "id": { - "title": "Id", - "type": "string" + "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" }, - "name": { - "title": "Name", - "type": "string" + "set_sampling_config": { + "default": false, + "description": "When true and sampling_config is omitted, clears the config to null.", + "title": "Set Sampling Config", + "type": "boolean" } }, - "required": [ - "id", - "entity_type", - "name", - "description" - ], - "title": "SearchResultResponse", + "title": "UpdateAgentRequest", "type": "object" }, - "routers__api__solutions__AiAssistantAcceptRequest": { - "description": "Request body for accepting a proposed plan.", + "routers__api__ai_assistant__AiAssistantFeedbackRequest": { + "description": "Request body for submitting AI assistant feedback.", "properties": { - "confirm_deletions": { - "default": false, - "description": "Must be true when the plan contains destructive actions", - "title": "Confirm Deletions", - "type": "boolean" - }, - "solution_description": { + "agent_conversation_id": { "anyOf": [ { + "format": "uuid", "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" + "description": "Agent conversation ID, if applicable.", + "title": "Agent Conversation Id" }, - "solution_name": { + "comment": { "anyOf": [ { "type": "string" @@ -10012,171 +9950,182 @@ "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": { + "description": "Optional comment.", + "title": "Comment" + }, + "context": { "anyOf": [ { - "format": "date-time", - "type": "string" + "additionalProperties": true, + "type": "object" }, { "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" + "description": "Additional context.", + "title": "Context" }, - "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": { + "conversation_id": { "anyOf": [ { - "type": "boolean" + "format": "uuid", + "type": "string" }, { "type": "null" } ], - "description": "Whether the suggestion was accepted or declined.", - "title": "Accepted" + "description": "Conversation ID for the interaction.", + "title": "Conversation Id" }, - "actions_taken": { + "feature": { + "description": "Feature name (e.g. 'source', 'solution').", + "title": "Feature", + "type": "string" + }, + "governance_conversation_id": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "format": "uuid", + "type": "string" }, { "type": "null" } ], - "description": "Actions taken by the AI.", - "title": "Actions Taken" + "description": "Governance conversation ID, if applicable.", + "title": "Governance Conversation Id" }, - "ai_response": { + "prompt_call_id": { "anyOf": [ { + "format": "uuid", "type": "string" }, { "type": "null" } ], - "description": "AI response text.", - "title": "Ai Response" + "description": "Prompt call ID for credit tracking.", + "title": "Prompt Call Id" }, - "created_at": { - "description": "Timestamp when the conversation was created.", - "title": "Created At", + "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": { - "description": "Unique identifier for the conversation turn.", - "format": "uuid", "title": "Id", "type": "string" }, - "user_input": { - "description": "User input text.", - "title": "User Input", + "user_id": { + "title": "User Id", "type": "string" + }, + "user_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Name" } }, "required": [ "id", - "user_input", - "ai_response", - "actions_taken", - "accepted", + "user_id", + "user_name", + "body", "created_at" ], - "title": "SolutionConversationResponse", + "title": "AlertCommentResponse", "type": "object" }, - "routers__api__solutions__SolutionKnowledgeBaseResponse": { + "routers__api__alerts__AlertDetailResponse": { "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" + "alert": { + "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" }, - "name": { - "title": "Name", - "type": "string" + "comments": { + "items": { + "$ref": "#/components/schemas/routers__api__alerts__AlertCommentResponse" + }, + "title": "Comments", + "type": "array" }, - "source_connection_ids": { - "description": "Source connection IDs linked to this knowledge base.", + "history": { "items": { - "format": "uuid", - "type": "string" + "$ref": "#/components/schemas/AlertHistoryEntryResponse" }, - "title": "Source Connection Ids", + "title": "History", + "type": "array" + }, + "subscribers": { + "items": { + "$ref": "#/components/schemas/routers__api__alerts__AlertSubscriberResponse" + }, + "title": "Subscribers", "type": "array" } }, "required": [ - "id", - "name" + "alert", + "history", + "comments", + "subscribers" ], - "title": "SolutionKnowledgeBaseResponse", + "title": "AlertDetailResponse", "type": "object" }, - "routers__api__solutions__SolutionListResponse": { - "description": "Response model for paginated solution list.", + "routers__api__alerts__AlertListResponse": { + "description": "``GET /alerts`` \u2014 always the canonical ``{data, pagination}`` envelope.", "properties": { "data": { "items": { - "$ref": "#/components/schemas/SolutionSummaryResponse" + "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" }, "title": "Data", "type": "array" @@ -10189,123 +10138,57 @@ "data", "pagination" ], - "title": "SolutionListResponse", + "title": "AlertListResponse", "type": "object" }, - "routers__api__solutions__SolutionResponse": { - "description": "Response model for solution data.", + "routers__api__alerts__AlertResponse": { "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", + "account_id": { + "title": "Account Id", "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": { + "agent_id": { "anyOf": [ { - "format": "date-time", "type": "string" }, { "type": "null" } ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" + "title": "Agent Id" }, - "date_to": { + "agent_run_id": { "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)." + "title": "Agent Run Id" }, - "metadata_filter": { + "alert_config_id": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" + "title": "Alert Config Id" }, - "query_filter": { + "alert_type": { + "title": "Alert Type", + "type": "string" + }, + "comment_count": { + "title": "Comment Count", + "type": "integer" + }, + "created_at": { "anyOf": [ { "type": "string" @@ -10314,63 +10197,53 @@ "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": { + "title": "Created At" + }, + "description": { "anyOf": [ { - "format": "date-time", "type": "string" }, { "type": "null" } ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" + "title": "Description" }, - "date_to": { + "details": { + "title": "Details" + }, + "id": { + "title": "Id", + "type": "string" + }, + "is_subscribed": { + "title": "Is Subscribed", + "type": "boolean" + }, + "mcp_client_id": { "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." + "title": "Mcp Client Id" }, - "metadata_filter": { + "source_connection_id": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" + "title": "Source Connection Id" }, - "query_filter": { + "source_connection_pull_id": { "anyOf": [ { "type": "string" @@ -10379,63 +10252,21 @@ "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" + "title": "Source Connection Pull Id" }, - "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", + "status": { + "title": "Status", "type": "string" }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Completion time.", - "title": "Completed At" + "subscriber_count": { + "title": "Subscriber Count", + "type": "integer" }, - "created_at": { - "description": "Creation time.", - "title": "Created At", + "title": { + "title": "Title", "type": "string" }, - "date_from": { + "updated_at": { "anyOf": [ { "type": "string" @@ -10444,10 +10275,34 @@ "type": "null" } ], - "description": "Date-from filter applied to this export.", - "title": "Date From" - }, - "date_to": { + "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" @@ -10456,15 +10311,17 @@ "type": "null" } ], - "description": "Date-to filter applied to this export.", - "title": "Date To" + "title": "Created At" }, - "destination": { - "description": "Storage destination.", - "title": "Destination", + "id": { + "title": "Id", "type": "string" }, - "error": { + "user_id": { + "title": "User Id", + "type": "string" + }, + "user_name": { "anyOf": [ { "type": "string" @@ -10473,10 +10330,64 @@ "type": "null" } ], - "description": "Error message if failed.", - "title": "Error" + "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" }, - "estimated_size_bytes": { + "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" @@ -10485,10 +10396,10 @@ "type": "null" } ], - "description": "Pre-run size estimate.", - "title": "Estimated Size Bytes" + "description": "Duration of the content in seconds.", + "title": "Content Duration" }, - "expires_at": { + "content_duration_display": { "anyOf": [ { "type": "string" @@ -10497,32 +10408,30 @@ "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" + "description": "Display string for content duration.", + "title": "Content Duration Display" }, - "format": { - "description": "Output format.", - "title": "Format", + "content_status": { + "description": "Status of the content.", + "title": "Content Status", "type": "string" }, - "id": { - "description": "Export job ID.", - "title": "Id", + "content_type": { + "description": "Type of the content.", + "title": "Content Type", "type": "string" }, - "item_count": { + "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" @@ -10531,35 +10440,40 @@ "type": "null" } ], - "description": "Items exported.", - "title": "Item Count" + "description": "Word count of the content.", + "title": "Content Word Count" }, - "metadata_filter": { + "description": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "Metadata filter applied to this export.", - "title": "Metadata Filter" + "description": "Description of the content.", + "title": "Description" }, - "progress_current": { + "error": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "description": "Items processed so far.", - "title": "Progress Current" + "description": "Error message, if any.", + "title": "Error" }, - "progress_total": { + "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.", + "title": "Extracted Media Capped", + "type": "boolean" + }, + "extracted_media_count": { "anyOf": [ { "type": "integer" @@ -10568,34 +10482,45 @@ "type": "null" } ], - "description": "Total items to process.", - "title": "Progress Total" + "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.", + "title": "Extracted Media Count" }, - "query_filter": { + "extracted_media_limit": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "description": "Query filter applied to this export.", - "title": "Query Filter" + "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.", + "title": "Extracted Media Limit" }, - "requested_by_user_id": { + "id": { + "description": "Unique identifier for the content version.", + "title": "Id", + "type": "string" + }, + "metadata": { "anyOf": [ { - "type": "string" + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "type": "array" }, { "type": "null" } ], - "description": "ID of the user who requested this export.", - "title": "Requested By User Id" + "description": "Metadata associated with the content.", + "title": "Metadata" }, - "requested_by_user_name": { + "published_at": { "anyOf": [ { "type": "string" @@ -10604,15 +10529,35 @@ "type": "null" } ], - "description": "Name of the user who requested this export.", - "title": "Requested By User Name" + "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": "Source connection ID.", + "description": "ID of the source connection.", "title": "Source Connection Id", "type": "string" }, - "started_at": { + "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" @@ -10621,15 +10566,25 @@ "type": "null" } ], - "description": "Processing start time.", - "title": "Started At" + "description": "Text content.", + "title": "Text Content" }, - "status": { - "description": "Job status.", - "title": "Status", - "type": "string" + "text_content_end": { + "description": "End position of the text content.", + "title": "Text Content End", + "type": "integer" }, - "storage_key": { + "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" @@ -10638,30 +10593,60 @@ "type": "null" } ], - "description": "S3 key of exported file.", - "title": "Storage Key" - }, - "updated_at": { - "description": "Last update time.", - "title": "Updated At", - "type": "string" + "description": "Title of the content.", + "title": "Title" } }, "required": [ "id", + "source_connection_content_version_id", "source_connection_id", - "account_id", - "format", - "destination", - "status", - "created_at", - "updated_at" + "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": "ExportResponse", + "title": "ContentDetailResponse", "type": "object" }, - "routers__api__sources__FileUploadResponse": { - "description": "Response model for file upload", + "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": [ @@ -10672,7 +10657,7 @@ "type": "null" } ], - "description": "ID of the created content version", + "description": "ID of the newly created content version. A replacement creates a new version rather than overwriting the previous one.", "title": "Content Version Id" }, "embedder_warning": { @@ -10684,7 +10669,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 the file's type is not embedded directly on this source, so indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED.", "title": "Embedder Warning" }, "filename": { @@ -10701,11 +10686,11 @@ "type": "null" } ], - "description": "ID of the duplicate source connection content version", + "description": "ID of the source connection content version. Unchanged by a replacement, so it stays a stable handle for the content.", "title": "Source Connection Content Version Id" }, "status": { - "description": "Processing status", + "description": "Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of another item.", "title": "Status", "type": "string" } @@ -10719,102 +10704,177 @@ "title": "FileUploadResponse", "type": "object" }, - "routers__api__sources__SourceListResponse": { - "description": "Response model for paginated source list", + "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": { - "data": { + "results": { "items": { - "$ref": "#/components/schemas/SourceResponse" + "$ref": "#/components/schemas/DocsSearchResultResponse" }, - "title": "Data", + "title": "Results", "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" } }, "required": [ - "data", - "pagination" + "results" ], - "title": "SourceListResponse", + "title": "DocsSearchResponse", "type": "object" }, - "schemas__model_responses__PromptModelResponse": { - "description": "Response model for prompt model data", + "routers__api__governance__GovernanceAiAssistantRequest": { + "description": "Request body for the governance AI assistant.", "properties": { - "default": { - "title": "Default", - "type": "boolean" - }, - "deprecated_at": { + "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": [ { - "format": "date-time", - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Deprecated At" + "description": "True if accepted, false if declined, null if pending.", + "title": "Accepted" }, - "description": { - "title": "Description", + "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" }, - "enabled": { - "title": "Enabled", - "type": "boolean" + "id": { + "description": "Conversation ID.", + "title": "Id", + "type": "string" }, - "family": { + "proposed_actions": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Family" + "description": "JSON of proposed actions, or null.", + "title": "Proposed Actions" }, - "family_generation": { + "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": [ { - "type": "number" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Family Generation" + "description": "Current configuration to refine, if any.", + "title": "Current Config" }, - "generation_credits_per_unit": { + "history_since": { "anyOf": [ { - "type": "number" + "format": "date-time", + "type": "string" }, { "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" + "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" }, - "generation_params": { + "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": [ { - "additionalProperties": true, - "type": "object" + "type": "boolean" }, { "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" + "description": "Whether the user accepted this proposal.", + "title": "Accepted" }, - "generation_unit_label": { + "ai_note": { "anyOf": [ { "type": "string" @@ -10823,124 +10883,201 @@ "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" + "description": "AI note from this turn.", + "title": "Ai Note" }, - "id": { - "title": "Id", + "conversation_id": { + "description": "Unique ID for this conversation turn.", + "title": "Conversation Id", "type": "string" }, - "image_generation_tool_credits_per_image": { + "resulting_config": { "anyOf": [ { - "type": "number" + "additionalProperties": true, + "type": "object" }, { "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" + "description": "The proposed configuration from this turn.", + "title": "Resulting Config" }, - "input_1h_cache_write_credits_per_1000_tokens": { + "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": "number" + "type": "boolean" }, { "type": "null" } ], - "title": "Input 1H Cache Write Credits Per 1000 Tokens" + "description": "Whether the user accepted the last proposal.", + "title": "Accepted" }, - "input_5m_cache_write_credits_per_1000_tokens": { + "ai_note": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input 5M Cache Write Credits Per 1000 Tokens" + "description": "AI note from the most recent turn.", + "title": "Ai Note" }, - "input_cache_hit_credits_per_1000_tokens": { + "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": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input Cache Hit Credits Per 1000 Tokens" + "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" }, - "input_credits_per_1000_tokens": { + "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": "number" + "type": "string" }, { "type": "null" } ], - "title": "Input Credits Per 1000 Tokens" - }, - "is_new": { - "default": false, - "title": "Is New", - "type": "boolean" + "title": "Agent Id" }, - "last_used": { - "default": false, - "title": "Last Used", - "type": "boolean" + "alert_type": { + "title": "Alert Type", + "type": "string" }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" + "created_at": { + "title": "Created At", + "type": "string" }, - "max_conversation_length": { - "title": "Max Conversation Length", - "type": "integer" + "id": { + "title": "Id", + "type": "string" }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" + "message": { + "title": "Message", + "type": "string" }, - "model_id": { - "title": "Model Id", + "model_name": { + "title": "Model Name", "type": "string" }, - "name": { - "title": "Name", + "prompt_model_id": { + "title": "Prompt Model Id", "type": "string" }, - "output_credits_per_1000_tokens": { + "read_at": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Output Credits Per 1000 Tokens" + "title": "Read At" }, - "payload_schema": { + "successor_model_name": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "description": "Model-specific JSON schema for advanced prompt_call json_template payloads.", - "title": "Payload Schema" - }, - "payload_schema_source_url": { + "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" @@ -10949,33 +11086,23 @@ "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" + "title": "Deprecated At" }, - "provider": { - "title": "Provider", + "description": { + "title": "Description", "type": "string" }, - "released_at": { + "effort_options": { "anyOf": [ { - "format": "date-time", - "type": "string" + "$ref": "#/components/schemas/EffortOptionsResponse" }, { "type": "null" } - ], - "title": "Released At" + ] }, - "schema_documentation_url": { + "family": { "anyOf": [ { "type": "string" @@ -10984,22 +11111,52 @@ "type": "null" } ], - "description": "Model documentation URL with request/response payload details.", - "title": "Schema Documentation Url" + "title": "Family" }, - "schema_notes": { + "family_generation": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Human-readable notes about request payload compatibility.", - "title": "Schema Notes" + "title": "Family Generation" }, - "successor_model_id": { + "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" @@ -11008,12 +11165,11 @@ "type": "null" } ], - "title": "Successor Model Id" + "title": "Released At" }, "sunset_at": { "anyOf": [ { - "format": "date-time", "type": "string" }, { @@ -11022,302 +11178,2491 @@ ], "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": { + } + }, + "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/PromptToolResponse" + "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" }, - "title": "Tools Disabled", + "title": "Alternatives", "type": "array" }, - "tools_enabled": { + "current_model_id": { + "title": "Current Model Id", + "type": "string" + }, + "current_model_name": { + "title": "Current Model Name", + "type": "string" + }, + "same_provider": { "items": { - "$ref": "#/components/schemas/PromptToolResponse" + "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" }, - "title": "Tools Enabled", + "title": "Same Provider", "type": "array" }, - "training_cutoff_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Training Cutoff At" - }, - "url": { + "successor": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" }, { "type": "null" } - ], - "title": "Url" + ] }, - "variants": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/VariantCategoryResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Variants" + "upgrades": { + "items": { + "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" + }, + "title": "Upgrades", + "type": "array" } }, "required": [ - "id", - "model_id", - "name", - "description", - "enabled", - "default", - "provider", - "max_context_tokens", - "max_output_tokens", - "max_conversation_length" + "current_model_id", + "current_model_name", + "upgrades", + "same_provider", + "alternatives" ], - "title": "PromptModelResponse", + "title": "ModelRecommendationsResponse", "type": "object" }, - "schemas__model_responses__ProviderGroupResponse": { - "description": "Response model for provider group with models", + "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": { - "models": { + "results": { "items": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" + "$ref": "#/components/schemas/routers__api__search__SearchResultResponse" }, - "title": "Models", + "title": "Results", "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" } }, "required": [ - "provider", - "models" + "results" ], - "title": "ProviderGroupResponse", + "title": "SearchResponse", "type": "object" }, - "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { - "description": "Per-mode rollup for evaluation activity.", + "routers__api__search__SearchResultResponse": { "properties": { - "failed": { - "title": "Failed", - "type": "integer" + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" + "entity_type": { + "title": "Entity Type", + "type": "string" }, - "flagged": { - "title": "Flagged", - "type": "integer" + "id": { + "title": "Id", + "type": "string" }, - "mode": { - "title": "Mode", + "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" }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" + "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" }, - "passed": { - "title": "Passed", - "type": "integer" + "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" }, - "total": { - "title": "Total", - "type": "integer" + "user_input": { + "description": "User input describing what to do", + "title": "User Input", + "type": "string" } }, "required": [ - "mode", - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate" + "user_input" ], - "title": "NonManualEvaluationModeStatResponse", + "title": "AiAssistantGenerateRequest", "type": "object" }, - "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { - "description": "Account-level summary for evaluations.", + "routers__api__solutions__SolutionAgentResponse": { "properties": { - "by_mode": { + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "knowledge_base_ids": { + "description": "Knowledge base IDs connected to this agent via triggers.", "items": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" + "format": "uuid", + "type": "string" }, - "title": "By Mode", + "title": "Knowledge Base Ids", "type": "array" }, - "failed": { - "title": "Failed", - "type": "integer" + "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" }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" + "actions_taken": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Actions taken by the AI.", + "title": "Actions Taken" }, - "flagged": { - "title": "Flagged", - "type": "integer" + "ai_response": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AI response text.", + "title": "Ai Response" }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" + "created_at": { + "description": "Timestamp when the conversation was created.", + "title": "Created At", + "type": "string" }, - "passed": { - "title": "Passed", - "type": "integer" + "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, and what the source content status endpoints take. Set when `status` is `uploaded`; `null` when `status` is `duplicate`, because no new version was created.", + "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 existing, already-indexed item this file duplicates, and what `GET /contents/{id}` takes. Set only when `status` is `duplicate`; `null` on a new upload, which has no such id until it finishes indexing.", + "title": "Source Connection Content Version Id" + }, + "status": { + "description": "`uploaded` for a new item, or `duplicate` when this exact file is already on the source.", + "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": { + "chat_capable": { + "default": true, + "description": "Whether this model can serve a chat request (`prompt_call`, `extract_data`). True for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. Authoritative: consumers must read this rather than inferring it from `generation_params` or `supported_output_media`, because the answer also depends on which inference interface serves the model \u2014 something no response field exposes.", + "title": "Chat Capable", + "type": "boolean" + }, + "default": { + "title": "Default", + "type": "boolean" + }, + "deprecated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deprecated At" + }, + "description": { + "title": "Description", + "type": "string" + }, + "effort_options": { + "anyOf": [ + { + "$ref": "#/components/schemas/EffortOptionsResponse" + }, + { + "type": "null" + } + ], + "description": "The reasoning-effort values a prompt_call or extract_data step may set as `effort` with this model. Null when the model takes none." + }, + "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 models with no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model that also serves the chat path is billed per token there instead, using the input/output token rates on this same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and this is the **highest** of them \u2014 read `generation_credits_per_variant` for the real spread rather than presenting this as the price.", + "title": "Generation Credits Per Unit" + }, + "generation_credits_per_variant": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Per-unit credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it exactly.", + "title": "Generation Credits Per Variant" + }, + "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. A present descriptor does NOT imply the model is generation-only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to tell whether a model with a descriptor can also be used as a chat model \u2014 do not branch on this field being non-null alone, and do not re-derive the answer from `supported_output_media`.", + "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" + } + ], + "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", + "title": "Input 1H Cache Write Credits Per 1000 Tokens" + }, + "input_30m_cache_write_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", + "title": "Input 30M Cache Write Credits Per 1000 Tokens" + }, + "input_5m_cache_write_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", + "title": "Input 5M Cache Write Credits Per 1000 Tokens" + }, + "input_cache_hit_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credits per 1,000 input tokens read from a prompt cache.", + "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" + }, + "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 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`)." + }, + "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": "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" + }, + "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 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" + }, + "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": "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" + }, + "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 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" + }, + "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": "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" + }, + "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": "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" + }, + "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": "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" + }, + "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 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" + }, + "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 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" + }, + "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": "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" }, - "total": { - "title": "Total", - "type": "integer" + "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" + } + } + } } }, - "required": [ - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate", - "by_mode" - ], - "title": "NonManualEvaluationSummaryResponse", - "type": "object" + "summary": "List Compatible Runs", + "tags": [ + "agent-evaluations" + ] } }, - "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": { + "/agents/evaluation-criteria/{criteria_id}/results": { "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", + "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": [ { - "description": "Page number", + "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, - "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", @@ -11336,7 +13681,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentListResponse" + "$ref": "#/components/schemas/EvaluationResultListResponse" } } }, @@ -11351,17 +13696,44 @@ } }, "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 agents", + "summary": "List Evaluation Results", "tags": [ - "agents" + "agent-evaluations" ] }, "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", + "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" }, @@ -11373,7 +13745,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__CreateAgentRequest" + "$ref": "#/components/schemas/CreateEvaluationResultRequest" } } }, @@ -11384,39 +13756,121 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" + "$ref": "#/components/schemas/EvaluationResultResponse" } } }, "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/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": "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/AgentDefinitionImportErrorResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "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`)." + "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": "Create an agent", + "summary": "Get Evaluation Summary", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/agents/agent-email-optouts": { + "/agents/evaluation-results/non-manual-summary": { "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", + "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": "Filter to one agent (account-wide opt-outs still apply)", + "description": "Scope the summary to a single agent. Omit for account-wide.", "in": "query", "name": "agent_id", "required": false, @@ -11429,31 +13883,52 @@ "type": "null" } ], - "description": "Filter to one agent (account-wide opt-outs still apply)", + "description": "Scope the summary to a single agent. Omit for account-wide.", "title": "Agent Id" } }, { "in": "query", - "name": "limit", + "name": "days", "required": false, "schema": { - "default": 50, - "maximum": 200, + "default": 30, + "maximum": 730, "minimum": 1, - "title": "Limit", + "title": "Days", "type": "integer" } }, { "in": "query", - "name": "offset", + "name": "start_date", "required": false, "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Start Date" + } + }, + { + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "End Date" } }, { @@ -11468,7 +13943,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentEmailOptOutListResponse" + "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse" } } }, @@ -11483,81 +13958,64 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Revoke an agent-email opt-out", + "summary": "Get Non Manual Evaluation Summary", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/agents/blocked-email-senders": { + "/agents/inbound-email-rejections": { "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", + "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": "limit", + "name": "agent_id", "required": false, "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single agent's rejections", + "title": "Agent Id" } }, { "in": "query", - "name": "offset", + "name": "limit", "required": false, "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", + "default": 50, + "maximum": 200, + "minimum": 1, + "title": "Limit", "type": "integer" } }, @@ -11573,7 +14031,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" + "items": { + "$ref": "#/components/schemas/InboundEmailRejectionResponse" + }, + "title": "Response List Inbound Email Rejections Api Api Agents Inbound Email Rejections Get", + "type": "array" } } }, @@ -11588,66 +14050,36 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "Block an inbound email sender or domain", + "summary": "List discarded inbound emails", "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", + "/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" @@ -11656,58 +14088,47 @@ "$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" + "$ref": "#/components/schemas/InboundEmailStatusResponse" } } }, "description": "Successful Response" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Set the governance auto-block mode", + "summary": "Account inbound-email overload status", "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", + "/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 has consumed no quota, 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": [ - { - "in": "path", - "name": "blocked_id", - "required": true, - "schema": { - "title": "Blocked Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -11716,40 +14137,46 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelQueuedRunsResponse" + } + } + }, "description": "Successful Response" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Unblock an inbound email sender", + "summary": "Cancel all queued inbound-email runs", "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" - } - }, + "/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" }, @@ -11758,38 +14185,46 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResumeInboundResponse" + } + } + }, "description": "Successful Response" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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 Evaluation Criteria", + "summary": "Manually resume paused inbound email", "tags": [ - "agent-evaluations" + "agents" ] - }, - "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", + } + }, + "/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\nCoverage: everything decidable from the payload itself \u2014 schema, step ids, nesting depth, text lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may still reject a payload this endpoint accepts.\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": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -11797,12 +14232,22 @@ "$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/EvaluationCriteriaResponse" + "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewResponse" } } }, @@ -11812,31 +14257,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" } } }, - "description": "Validation Error" + "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`)." + }, + "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 Evaluation Criteria", + "summary": "Preview an agent_definition import", "tags": [ - "agent-evaluations" + "agents" ] - }, - "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", + } + }, + "/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": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -11848,7 +14304,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateEvaluationCriteriaRequest" + "$ref": "#/components/schemas/routers__api__agents__AgentTraceSearchRequest" } } }, @@ -11859,7 +14315,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" + "$ref": "#/components/schemas/AgentTraceSearchResponse" } } }, @@ -11874,68 +14330,46 @@ } }, "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": "Update Evaluation Criteria", + "summary": "Search agent traces", "tags": [ - "agent-evaluations" + "agents" ] } }, - "/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", + "/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; it has consumed no quota.\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": "criteria_id", + "name": "run_id", "required": true, "schema": { - "title": "Criteria Id", + "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" - } - }, - { - "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" }, @@ -11948,7 +14382,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompatibleRunListResponse" + "$ref": "#/components/schemas/AgentRunResponse" } } }, @@ -11963,107 +14397,54 @@ } }, "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" + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + } + }, + "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" } - ], - "title": "Time To" + } } - }, + } + }, + "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": "query", - "name": "page", - "required": false, + "in": "path", + "name": "run_id", + "required": true, "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" + "title": "Run Id", + "type": "string" } }, { + "description": "If true, include per-step outputs with timing, durations, and credits.", "in": "query", - "name": "limit", + "name": "include_step_outputs", "required": false, "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" + "default": false, + "description": "If true, include per-step outputs with timing, durations, and credits.", + "title": "Include Step Outputs", + "type": "boolean" } }, { @@ -12078,7 +14459,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationResultListResponse" + "$ref": "#/components/schemas/AgentRunResponse" } } }, @@ -12093,23 +14474,43 @@ } }, "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 Evaluation Results", + "summary": "Get an agent run", "tags": [ - "agent-evaluations" + "agents" ] - }, - "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", + } + }, + "/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": "criteria_id", + "name": "agent_id", "required": true, "schema": { - "title": "Criteria Id", + "title": "Agent Id", "type": "string" } }, @@ -12120,55 +14521,54 @@ "$ref": "#/components/parameters/Seclai-Version" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationResultRequest" - } - } - }, - "required": true - }, "responses": { - "201": { + "204": { + "description": "Successful Response" + }, + "422": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationResultResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "description": "Successful Response" + "description": "Validation Error" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Create Evaluation Result", + "summary": "Delete an agent", "tags": [ - "agent-evaluations" + "agents" ] - } - }, - "/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", + "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": "criteria_id", + "name": "agent_id", "required": true, "schema": { - "title": "Criteria Id", + "title": "Agent Id", "type": "string" } }, @@ -12184,7 +14584,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationResultSummaryResponse" + "$ref": "#/components/schemas/AgentSummaryResponse" } } }, @@ -12199,79 +14599,42 @@ } }, "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 Evaluation Summary", + "summary": "Get an agent", "tags": [ - "agent-evaluations" + "agents" ] - } - }, - "/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", + }, + "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": [ { - "description": "Scope the summary to a single agent. Omit for account-wide.", - "in": "query", + "in": "path", "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, + "required": true, "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" + "title": "Agent Id", + "type": "string" } }, { @@ -12281,12 +14644,22 @@ "$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/schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse" + "$ref": "#/components/schemas/AgentSummaryResponse" } } }, @@ -12296,28 +14669,66 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" } } }, - "description": "Validation Error" + "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`)." + }, + "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 Non Manual Evaluation Summary", + "summary": "Update agent metadata", "tags": [ - "agent-evaluations" + "agents" ] } }, - "/agents/inbound-email-rejections": { + "/agents/{agent_id}/ai-assistant/conversations": { "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", + "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": [ { - "description": "Filter to a single agent's rejections", - "in": "query", + "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": [ @@ -12328,22 +14739,37 @@ "type": "null" } ], - "description": "Filter to a single agent's rejections", - "title": "Agent Id" + "description": "Step ID to filter by.", + "title": "Step Id" } }, { + "description": "Max turns to return.", "in": "query", "name": "limit", "required": false, "schema": { - "default": 50, - "maximum": 200, + "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" }, @@ -12356,11 +14782,7 @@ "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/InboundEmailRejectionResponse" - }, - "title": "Response List Inbound Email Rejections Api Api Agents Inbound Email Rejections Get", - "type": "array" + "$ref": "#/components/schemas/AiConversationHistoryResponse" } } }, @@ -12375,49 +14797,46 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundEmailStatusResponse" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" + "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": "Account inbound-email overload status", + "summary": "Get AI conversation history", "tags": [ "agents" ] } }, - "/agents/inbound-email-status/cancel-queued": { + "/agents/{agent_id}/ai-assistant/generate-steps": { "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", + "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" }, @@ -12425,29 +14844,76 @@ "$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/CancelQueuedRunsResponse" + "$ref": "#/components/schemas/GenerateAgentStepsResponse" } } }, "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": "Cancel all queued inbound-email runs", + "summary": "Generate agent workflow", "tags": [ "agents" ] } }, - "/agents/inbound-email-status/resume": { + "/agents/{agent_id}/ai-assistant/step-config": { "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", + "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" }, @@ -12455,29 +14921,85 @@ "$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/ResumeInboundResponse" + "$ref": "#/components/schemas/GenerateStepConfigResponse" } } }, "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": "Manually resume paused inbound email", + "summary": "Generate step configuration", "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", + "/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" }, @@ -12489,7 +15011,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewRequest" + "$ref": "#/components/schemas/MarkAiSuggestionRequest" } } }, @@ -12500,7 +15022,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewResponse" + "$ref": "#/components/schemas/OkResponse" } } }, @@ -12510,24 +15032,51 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "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`)." + "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": "Preview an agent_definition import", + "summary": "Accept or decline suggestion", "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", + "/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" }, @@ -12535,22 +15084,12 @@ "$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" + "$ref": "#/components/schemas/AgentAttachmentRefsApiResponse" } } }, @@ -12565,25 +15104,43 @@ } }, "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": "Search agent traces", + "summary": "Get agent attachment-reference contract", "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", + "/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": "run_id", + "name": "agent_id", "required": true, "schema": { - "title": "Run Id", + "title": "Agent Id", "type": "string" } }, @@ -12599,7 +15156,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunResponse" + "items": { + "$ref": "#/components/schemas/AgentCallerApiResponse" + }, + "title": "Response Get Agent Callers Api Api Agents Agent Id Callers Get", + "type": "array" } } }, @@ -12614,38 +15175,46 @@ } }, "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": "Cancel an agent run", + "summary": "List agents that call this agent", "tags": [ "agents" ] - }, + } + }, + "/agents/{agent_id}/definition": { "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", + "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). To stream **and** return a schema-validated payload, add a sibling branch `extract_content` (`expected_format: \"json\"` + `json_schema`) \u2192 `display_result` under the same `prompt_call` \u2014 a `display_result` takes precedence over the stream regardless of which finishes first, so its validated output becomes the run's result while the tokens act as a progress channel\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": "run_id", + "name": "agent_id", "required": true, "schema": { - "title": "Run Id", + "title": "Agent 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" }, @@ -12658,7 +15227,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunResponse" + "$ref": "#/components/schemas/AgentDefinitionResponse" } } }, @@ -12673,18 +15242,34 @@ } }, "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 an agent run", + "summary": "Get agent definition", "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", + }, + "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", @@ -12702,8 +15287,25 @@ "$ref": "#/components/parameters/Seclai-Version" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAgentDefinitionRequest" + } + } + }, + "required": true + }, "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentDefinitionResponse" + } + } + }, "description": "Successful Response" }, "422": { @@ -12715,16 +15317,36 @@ } }, "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 an agent", + "summary": "Update agent definition", "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", + } + }, + "/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", @@ -12762,16 +15384,36 @@ } }, "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 an agent", + "summary": "Pause (disable) 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", + } + }, + "/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", @@ -12789,16 +15431,6 @@ "$ref": "#/components/parameters/Seclai-Version" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__UpdateAgentRequest" - } - } - }, - "required": true - }, "responses": { "200": { "content": { @@ -12814,23 +15446,41 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "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`)." + "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": "Update agent metadata", + "summary": "Resume (enable) a paused agent", "tags": [ "agents" ] } }, - "/agents/{agent_id}/ai-assistant/conversations": { + "/agents/{agent_id}/evaluation-criteria": { "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", + "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", @@ -12842,61 +15492,28 @@ } }, { - "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", + "name": "page", "required": false, "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID to filter by.", - "title": "Step Id" + "default": 1, + "minimum": 1, + "title": "Page", + "type": "integer" } }, { - "description": "Max turns to return.", "in": "query", "name": "limit", "required": false, "schema": { - "default": 10, - "description": "Max turns to return.", - "maximum": 50, + "default": 20, + "maximum": 100, "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" }, @@ -12909,7 +15526,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiConversationHistoryResponse" + "items": { + "$ref": "#/components/schemas/EvaluationCriteriaResponse" + }, + "title": "Response List Evaluation Criteria Api Agents Agent Id Evaluation Criteria Get", + "type": "array" } } }, @@ -12924,18 +15545,34 @@ } }, "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 AI conversation history", + "summary": "List Evaluation Criteria", "tags": [ - "agents" + "agent-evaluations" ] - } - }, - "/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", + "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", @@ -12957,18 +15594,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsRequest" + "$ref": "#/components/schemas/CreateEvaluationCriteriaRequest" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsResponse" + "$ref": "#/components/schemas/EvaluationCriteriaResponse" } } }, @@ -12983,18 +15620,36 @@ } }, "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": "Generate agent workflow", + "summary": "Create Evaluation Criteria", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/agents/{agent_id}/ai-assistant/step-config": { + "/agents/{agent_id}/evaluation-criteria/test-draft": { "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", + "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.", + "operationId": "test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post", "parameters": [ { "in": "path", @@ -13016,7 +15671,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateStepConfigRequest" + "$ref": "#/components/schemas/TestDraftEvaluationRequest" } } }, @@ -13027,7 +15682,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateStepConfigResponse" + "$ref": "#/components/schemas/TestDraftEvaluationResponse" } } }, @@ -13042,18 +15697,36 @@ } }, "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": "Generate step configuration", + "summary": "Test Draft Evaluation", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/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", + "/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", @@ -13065,12 +15738,100 @@ } }, { - "in": "path", - "name": "conversation_id", - "required": true, + "in": "query", + "name": "status", + "required": false, "schema": { - "title": "Conversation Id", - "type": "string" + "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" } }, { @@ -13080,22 +15841,12 @@ "$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" + "$ref": "#/components/schemas/EvaluationResultWithCriteriaListResponse" } } }, @@ -13110,26 +15861,131 @@ } }, "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": "Accept or decline suggestion", + "summary": "List Agent Evaluation Results", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/agents/{agent_id}/attachment-references": { + "/agents/{agent_id}/evaluation-runs": { "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", + "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, + "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": { - "title": "Agent Id", - "type": "string" + "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" } }, { @@ -13144,7 +16000,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentAttachmentRefsApiResponse" + "$ref": "#/components/schemas/EvaluationRunSummaryListResponse" } } }, @@ -13159,71 +16015,36 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/AgentCallerApiResponse" - }, - "title": "Response Get Agent Callers Api Api Agents Agent Id Callers Get", - "type": "array" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "List agents that call this agent", + "summary": "List Evaluation Runs", "tags": [ - "agents" + "agent-evaluations" ] } }, - "/agents/{agent_id}/definition": { + "/agents/{agent_id}/export": { "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", + "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 `\"5\"`)\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", @@ -13234,6 +16055,18 @@ "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" }, @@ -13246,7 +16079,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" + "$ref": "#/components/schemas/AgentExportResponse" } } }, @@ -13261,75 +16094,36 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "Update agent definition", + "summary": "Export 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", + "/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", @@ -13340,6 +16134,15 @@ "type": "string" } }, + { + "in": "path", + "name": "upload_id", + "required": true, + "schema": { + "title": "Upload Id", + "type": "string" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -13352,7 +16155,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" + "$ref": "#/components/schemas/UploadAgentInputApiResponse" } } }, @@ -13367,67 +16170,36 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "Resume (enable) a paused agent", + "summary": "Get upload status", "tags": [ "agents" ] } }, - "/agents/{agent_id}/evaluation-criteria": { + "/agents/{agent_id}/runs": { "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", + "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", @@ -13439,28 +16211,50 @@ } }, { + "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, + "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" }, @@ -13473,11 +16267,7 @@ "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - }, - "title": "Response List Evaluation Criteria Api Agents Agent Id Evaluation Criteria Get", - "type": "array" + "$ref": "#/components/schemas/routers__api__agents__AgentRunListResponse" } } }, @@ -13492,16 +16282,34 @@ } }, "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 Evaluation Criteria", + "summary": "List agent runs", "tags": [ - "agent-evaluations" + "agents" ] }, "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", + "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.", + "operationId": "run_agent_api_agents__agent_id__runs_post", "parameters": [ { "in": "path", @@ -13523,23 +16331,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEvaluationCriteriaRequest" + "$ref": "#/components/schemas/AgentRunRequest" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" + "$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": { @@ -13549,18 +16367,36 @@ } }, "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": "Create Evaluation Criteria", + "summary": "Run an agent", "tags": [ - "agent-evaluations" + "agents" ] } }, - "/agents/{agent_id}/evaluation-criteria/test-draft": { + "/agents/{agent_id}/runs/stream": { "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", + "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.", + "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", "parameters": [ { "in": "path", @@ -13582,7 +16418,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationRequest" + "$ref": "#/components/schemas/AgentRunStreamRequest" } } }, @@ -13592,12 +16428,26 @@ "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": { - "$ref": "#/components/schemas/TestDraftEvaluationResponse" + "type": "string" } } }, - "description": "Successful Response" + "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": { @@ -13608,18 +16458,36 @@ } }, "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": "Test Draft Evaluation", + "summary": "Run an agent (stream events)", "tags": [ - "agent-evaluations" + "agents" ] } }, - "/agents/{agent_id}/evaluation-results": { + "/agents/{agent_id}/runs/{run_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", + "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", @@ -13631,77 +16499,12 @@ } }, { - "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, + "in": "path", + "name": "run_id", + "required": true, "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" + "title": "Run Id", + "type": "string" } }, { @@ -13739,7 +16542,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaListResponse" + "items": { + "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" + }, + "title": "Response List Run Evaluation Results Api Agents Agent Id Runs Run Id Evaluation Results Get", + "type": "array" } } }, @@ -13754,113 +16561,53 @@ } }, "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 Agent Evaluation Results", + "summary": "List Run 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" - } - }, + "/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": "query", - "name": "page", - "required": false, + "in": "path", + "name": "agent_id", + "required": true, "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" + "title": "Agent Id", + "type": "string" } }, { - "in": "query", - "name": "limit", - "required": false, + "in": "path", + "name": "trigger_id", + "required": true, "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" + "title": "Trigger Id", + "type": "string" } }, { @@ -13870,12 +16617,22 @@ "$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/EvaluationRunSummaryListResponse" + "$ref": "#/components/schemas/EmailTriggerConfigResponse" } } }, @@ -13890,18 +16647,36 @@ } }, "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 Evaluation Runs", + "summary": "Configure an EMAIL_RECEIVED trigger", "tags": [ - "agent-evaluations" + "agents" ] } }, - "/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", + "/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", @@ -13913,17 +16688,63 @@ } }, { - "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": { + "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" }, @@ -13931,12 +16752,22 @@ "$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/AgentExportResponse" + "$ref": "#/components/schemas/AiAssistantFeedbackResponse" } } }, @@ -13951,37 +16782,105 @@ } }, "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": "Export agent definition", + "summary": "Submit AI assistant feedback", "tags": [ - "agents" + "ai-assistant" ] } }, - "/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", + "/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": [ { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } + "$ref": "#/components/parameters/X-Account-Id" }, { - "in": "path", - "name": "upload_id", - "required": true, - "schema": { - "title": "Upload Id", - "type": "string" + "$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" + }, + "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": "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" }, @@ -13989,12 +16888,22 @@ "$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/UploadAgentInputApiResponse" + "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" } } }, @@ -14007,73 +16916,64 @@ "$ref": "#/components/schemas/HTTPValidationError" } } - }, - "description": "Validation Error" + }, + "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 upload status", + "summary": "Generate a memory bank configuration (standalone)", "tags": [ - "agents" + "ai-assistant" ] } }, - "/agents/{agent_id}/runs": { + "/ai-assistant/memory-bank/last-conversation": { "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", + "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": [ { - "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", + "description": "Max turns.", "in": "query", "name": "limit", "required": false, "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, + "default": 5, + "description": "Max turns.", + "maximum": 50, "minimum": 1, "title": "Limit", "type": "integer" } }, { - "description": "Filter runs by status", + "description": "Skip count.", "in": "query", - "name": "status", + "name": "offset", "required": false, "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus" - }, - { - "type": "null" - } - ], - "description": "Filter runs by status", - "title": "Status" + "default": 0, + "description": "Skip count.", + "minimum": 0, + "title": "Offset", + "type": "integer" } }, { @@ -14088,7 +16988,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentRunListResponse" + "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" } } }, @@ -14103,23 +17003,44 @@ } }, "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 agent runs", + "summary": "Fetch memory bank AI conversation history", "tags": [ - "agents" + "ai-assistant" ] - }, - "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", + } + }, + "/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": "agent_id", + "name": "conversation_id", "required": true, "schema": { - "title": "Agent Id", + "format": "uuid", + "title": "Conversation Id", "type": "string" } }, @@ -14134,7 +17055,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunRequest" + "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" } } }, @@ -14145,53 +17066,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunResponse" + "$ref": "#/components/schemas/OkResponse" } } }, "description": "Successful Response" }, - "402": { + "422": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." + "description": "Validation Error" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Run an agent", + "summary": "Accept or decline a memory bank AI suggestion", "tags": [ - "agents" + "ai-assistant" ] } }, - "/agents/{agent_id}/runs/stream": { + "/ai-assistant/solution": { "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", + "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": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -14203,7 +17123,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunStreamRequest" + "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" } } }, @@ -14211,28 +17131,14 @@ }, "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" + "$ref": "#/components/schemas/AiAssistantGenerateResponse" } } }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." + "description": "Successful Response" }, "422": { "content": { @@ -14243,122 +17149,37 @@ } }, "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": { + "503": { "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" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "List Run Evaluation Results", + "summary": "Generate a solution plan (standalone)", "tags": [ - "agent-evaluations" + "ai-assistant" ] - } - }, - "/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" - } - }, + } + }, + "/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" }, @@ -14370,7 +17191,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" + "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" } } }, @@ -14381,7 +17202,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmailTriggerConfigResponse" + "$ref": "#/components/schemas/AiAssistantGenerateResponse" } } }, @@ -14396,68 +17217,47 @@ } }, "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": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { + "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": { - "$ref": "#/components/schemas/HTTPValidationError" + "type": "integer" } } - }, - "description": "Validation Error" + } } }, - "summary": "Upload file input", + "summary": "Generate a source plan (standalone)", "tags": [ - "agents" + "ai-assistant" ] } }, - "/ai-assistant/feedback": { + "/ai-assistant/{conversation_id}/accept": { "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": "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" }, @@ -14469,7 +17269,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__ai_assistant__AiAssistantFeedbackRequest" + "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" } } }, @@ -14480,7 +17280,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiAssistantFeedbackResponse" + "$ref": "#/components/schemas/AiAssistantAcceptResponse" } } }, @@ -14495,19 +17295,47 @@ } }, "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": "Submit AI assistant feedback", + "summary": "Accept and execute a standalone plan", "tags": [ "ai-assistant" ] } }, - "/ai-assistant/knowledge-base": { + "/ai-assistant/{conversation_id}/decline": { "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", + "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" }, @@ -14515,49 +17343,169 @@ "$ref": "#/components/parameters/Seclai-Version" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, "responses": { - "200": { + "204": { + "description": "Successful Response" + }, + "422": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "description": "Successful Response" + "description": "Validation Error" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Generate a knowledge base plan (standalone)", + "summary": "Decline a standalone plan", "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", + "/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" }, @@ -14565,22 +17513,12 @@ "$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" + "$ref": "#/components/schemas/routers__api__alerts__AlertListResponse" } } }, @@ -14595,43 +17533,115 @@ } }, "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": "Generate a memory bank configuration (standalone)", + "summary": "List alerts", "tags": [ - "ai-assistant" + "alerts" ] } }, - "/ai-assistant/memory-bank/last-conversation": { + "/alerts/configs": { "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", + "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": "Max turns.", + "description": "Filter by agent ID", "in": "query", - "name": "limit", + "name": "agent_id", "required": false, "schema": { - "default": 5, - "description": "Max turns.", - "maximum": 50, + "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": "Limit", + "title": "Page", "type": "integer" } }, { - "description": "Skip count.", + "description": "Items per page", "in": "query", - "name": "offset", + "name": "limit", "required": false, "schema": { - "default": 0, - "description": "Skip count.", - "minimum": 0, - "title": "Offset", + "default": 50, + "description": "Items per page", + "maximum": 100, + "minimum": 1, + "title": "Limit", "type": "integer" } }, @@ -14647,7 +17657,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" + "$ref": "#/components/schemas/AlertConfigListResponse" } } }, @@ -14662,29 +17672,35 @@ } }, "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": "Fetch memory bank AI conversation history", + "summary": "List alert configs", "tags": [ - "ai-assistant" + "alerts" ] - } - }, - "/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", + }, + "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": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -14696,18 +17712,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" + "$ref": "#/components/schemas/CreateAlertConfigRequest" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OkResponse" + "$ref": "#/components/schemas/AlertConfigResponse" } } }, @@ -14722,19 +17738,46 @@ } }, "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": "Accept or decline a memory bank AI suggestion", + "summary": "Create alert config", "tags": [ - "ai-assistant" + "alerts" ] } }, - "/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", + "/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" }, @@ -14742,49 +17785,57 @@ "$ref": "#/components/parameters/Seclai-Version" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, "responses": { - "200": { + "204": { + "description": "Successful Response" + }, + "422": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" + "$ref": "#/components/schemas/HTTPValidationError" } } }, - "description": "Successful Response" + "description": "Validation Error" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Generate a solution plan (standalone)", + "summary": "Delete alert config", "tags": [ - "ai-assistant" + "alerts" ] - } - }, - "/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", + }, + "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" }, @@ -14792,22 +17843,12 @@ "$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" + "$ref": "#/components/schemas/AlertConfigResponse" } } }, @@ -14822,26 +17863,41 @@ } }, "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": "Generate a source plan (standalone)", + "summary": "Get alert config", "tags": [ - "ai-assistant" + "alerts" ] - } - }, - "/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", + }, + "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": "conversation_id", + "name": "config_id", "required": true, "schema": { - "format": "uuid", - "title": "Conversation Id", + "title": "Config Id", "type": "string" } }, @@ -14856,7 +17912,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" + "$ref": "#/components/schemas/UpdateAlertConfigRequest" } } }, @@ -14867,7 +17923,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" + "$ref": "#/components/schemas/AlertConfigResponse" } } }, @@ -14882,27 +17938,66 @@ } }, "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": "Accept and execute a standalone plan", + "summary": "Update alert config", "tags": [ - "ai-assistant" + "alerts" ] } }, - "/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", + "/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": [ { - "in": "path", - "name": "conversation_id", - "required": true, + "description": "Optional organization filter", + "in": "query", + "name": "organization_id", + "required": false, "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" + "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" } }, { @@ -14913,7 +18008,14 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationAlertPreferenceListResponse" + } + } + }, "description": "Successful Response" }, "422": { @@ -14925,136 +18027,131 @@ } }, "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": "Decline a standalone plan", + "summary": "List organization alert delivery preferences", "tags": [ - "ai-assistant" + "alerts" ] } }, - "/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", + "/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": [ { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, + "in": "path", + "name": "organization_id", + "required": true, "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" + "format": "uuid", + "title": "Organization Id", + "type": "string" } }, { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, + "in": "path", + "name": "alert_type", + "required": true, "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" + "title": "Alert Type", + "type": "string" } }, { - "description": "Filter by alert status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by alert status", - "title": "Status" - } + "$ref": "#/components/parameters/X-Account-Id" }, { - "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" + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__alerts__UpdateOrganizationAlertPreferenceRequest" + } } }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } + } + }, + "description": "Successful Response" }, - { - "description": "From (ISO 8601)", - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" } - ], - "description": "From (ISO 8601)", - "title": "Time From" + } + }, + "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": "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": [ { - "description": "To (ISO 8601)", - "in": "query", - "name": "time_to", - "required": false, + "in": "path", + "name": "alert_id", + "required": true, "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "To (ISO 8601)", - "title": "Time To" + "title": "Alert Id", + "type": "string" } }, { @@ -15069,7 +18166,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertListResponse" + "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" } } }, @@ -15084,98 +18181,44 @@ } }, "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 alerts", + "summary": "Get alert detail", "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", + "/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": [ { - "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, + "in": "path", + "name": "alert_id", + "required": true, "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" + "title": "Alert Id", + "type": "string" } }, { @@ -15185,12 +18228,22 @@ "$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/AlertConfigListResponse" + "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" } } }, @@ -15205,17 +18258,46 @@ } }, "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 alert configs", + "summary": "Add alert comment", "tags": [ "alerts" ] - }, + } + }, + "/alerts/{alert_id}/status": { "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", + "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" }, @@ -15227,18 +18309,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAlertConfigRequest" + "$ref": "#/components/schemas/ChangeStatusRequest" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" + "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" } } }, @@ -15253,25 +18335,43 @@ } }, "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": "Create alert config", + "summary": "Change alert status", "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", + "/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, for as long as they remain an owner or administrator of the account.\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": "config_id", + "name": "alert_id", "required": true, "schema": { - "title": "Config Id", + "title": "Alert Id", "type": "string" } }, @@ -15283,7 +18383,14 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" + } + } + }, "description": "Successful Response" }, "422": { @@ -15295,23 +18402,43 @@ } }, "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 alert config", + "summary": "Subscribe to alert", "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", + } + }, + "/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": "config_id", + "name": "alert_id", "required": true, "schema": { - "title": "Config Id", + "title": "Alert Id", "type": "string" } }, @@ -15327,7 +18454,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" + "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" } } }, @@ -15342,26 +18469,37 @@ } }, "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 alert config", + "summary": "Unsubscribe from alert", "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", + } + }, + "/cloud-drives": { + "get": { + "description": "List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` when creating a `cloud_drive` content source or binding a file-change agent trigger. `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "list_cloud_drives_api_api_cloud_drives_get", "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -15369,80 +18507,51 @@ "$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" + "items": { + "$ref": "#/components/schemas/CloudDriveResponseModel" + }, + "title": "Response List Cloud Drives Api Api Cloud Drives Get", + "type": "array" } } }, "description": "Successful Response" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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": "Update alert config", + "summary": "List the account's cloud-drive connections", "tags": [ - "alerts" + "cloud_drives" ] } }, - "/alerts/organization-preferences/list": { + "/cloud-drives/providers": { "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", + "description": "List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, Google Drive), with the permissions each requests. A provider missing from this list cannot be connected here.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "list_cloud_drive_providers_api_api_cloud_drives_providers_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" }, @@ -15455,50 +18564,53 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationAlertPreferenceListResponse" + "items": { + "$ref": "#/components/schemas/CloudDriveProviderResponseModel" + }, + "title": "Response List Cloud Drive Providers Api Api Cloud Drives Providers Get", + "type": "array" } } }, "description": "Successful Response" }, - "422": { + "503": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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 organization alert delivery preferences", + "summary": "List configured cloud-drive providers", "tags": [ - "alerts" + "cloud_drives" ] } }, - "/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", + "/cloud-drives/{connection_id}": { + "delete": { + "description": "Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on it \u2014 a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so treat the 409 as the authoritative check rather than a clean /agents response.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "delete_cloud_drive_api_api_cloud_drives__connection_id__delete", "parameters": [ { "in": "path", - "name": "organization_id", + "name": "connection_id", "required": true, "schema": { "format": "uuid", - "title": "Organization Id", - "type": "string" - } - }, - { - "in": "path", - "name": "alert_type", - "required": true, - "schema": { - "title": "Alert Type", + "title": "Connection Id", "type": "string" } }, @@ -15509,22 +18621,12 @@ "$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" + "$ref": "#/components/schemas/OkResponse" } } }, @@ -15539,25 +18641,42 @@ } }, "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": "Update organization alert delivery preference", + "summary": "Delete a cloud-drive connection", "tags": [ - "alerts" + "cloud_drives" ] - } - }, - "/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", + "description": "Fetch a single cloud-drive connection by id.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "get_cloud_drive_api_api_cloud_drives__connection_id__get", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "connection_id", "required": true, "schema": { - "title": "Alert Id", + "format": "uuid", + "title": "Connection Id", "type": "string" } }, @@ -15573,7 +18692,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" + "$ref": "#/components/schemas/CloudDriveResponseModel" } } }, @@ -15588,25 +18707,42 @@ } }, "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 alert detail", + "summary": "Get a cloud-drive connection", "tags": [ - "alerts" + "cloud_drives" ] - } - }, - "/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", + }, + "patch": { + "description": "Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, so existing files in the new folder are not replayed as triggers.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "update_cloud_drive_api_api_cloud_drives__connection_id__patch", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "connection_id", "required": true, "schema": { - "title": "Alert Id", + "format": "uuid", + "title": "Connection Id", "type": "string" } }, @@ -15621,7 +18757,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AddCommentRequest" + "$ref": "#/components/schemas/CloudDriveUpdateRequest" } } }, @@ -15632,7 +18768,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" + "$ref": "#/components/schemas/CloudDriveResponseModel" } } }, @@ -15647,25 +18783,44 @@ } }, "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": "Add alert comment", + "summary": "Update a cloud-drive connection", "tags": [ - "alerts" + "cloud_drives" ] } }, - "/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", + "/cloud-drives/{connection_id}/agents": { + "get": { + "description": "Agents that reference this connection \u2014 via a cloud-drive step, a `prompt_call` cloud-drive tool, or a file-change trigger. Check this before disconnecting or deleting a connection.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "connection_id", "required": true, "schema": { - "title": "Alert Id", + "format": "uuid", + "title": "Connection Id", "type": "string" } }, @@ -15676,22 +18831,16 @@ "$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" + "items": { + "$ref": "#/components/schemas/AgentUsingCloudDriveResponseModel" + }, + "title": "Response Get Agents Using Cloud Drive Api Api Cloud Drives Connection Id Agents Get", + "type": "array" } } }, @@ -15706,25 +18855,44 @@ } }, "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": "Change alert status", + "summary": "List agents using a cloud-drive connection", "tags": [ - "alerts" + "cloud_drives" ] } }, - "/alerts/{alert_id}/subscribe": { + "/cloud-drives/{connection_id}/disconnect": { "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", + "description": "Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it can be reconnected from the app. Agents bound to it stop firing until it is reconnected.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "connection_id", "required": true, "schema": { - "title": "Alert Id", + "format": "uuid", + "title": "Connection Id", "type": "string" } }, @@ -15740,7 +18908,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" + "$ref": "#/components/schemas/CloudDriveResponseModel" } } }, @@ -15755,28 +18923,59 @@ } }, "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": "Subscribe to alert", + "summary": "Disconnect a cloud-drive connection", "tags": [ - "alerts" + "cloud_drives" ] } }, - "/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", + "/cloud-drives/{connection_id}/rejections": { + "get": { + "description": "Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync or per-account run cap was hit, so remaining changes were dropped).\n\nThis is the answer to \"why didn't my agent run for that file?\" \u2014 a skipped file fires no trigger and appears nowhere else.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", + "operationId": "list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "connection_id", "required": true, "schema": { - "title": "Alert Id", + "format": "uuid", + "title": "Connection Id", "type": "string" } }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 50, + "maximum": 200, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -15789,7 +18988,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" + "items": { + "$ref": "#/components/schemas/CloudDriveRejectionResponseModel" + }, + "title": "Response List Cloud Drive Rejections Api Api Cloud Drives Connection Id Rejections Get", + "type": "array" } } }, @@ -15804,17 +19007,35 @@ } }, "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": "Unsubscribe from alert", + "summary": "List files this connection did not process", "tags": [ - "alerts" + "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.", + "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": [ { @@ -15837,6 +19058,9 @@ "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": { @@ -15846,6 +19070,24 @@ } }, "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", @@ -15913,6 +19155,24 @@ } }, "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", @@ -15921,7 +19181,7 @@ ] }, "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.", + "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": [ { @@ -15961,6 +19221,9 @@ }, "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": { @@ -15970,6 +19233,24 @@ } }, "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", @@ -16039,6 +19320,24 @@ } }, "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 content embeddings", @@ -16049,7 +19348,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.\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.", + "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.", "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", "parameters": [ { @@ -16089,6 +19388,9 @@ }, "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": { @@ -16098,6 +19400,24 @@ } }, "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 a new upload", @@ -16181,6 +19501,24 @@ } }, "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": "Search documentation", @@ -16211,6 +19549,24 @@ } }, "description": "Successful Response" + }, + "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 the account's email domains + plan capabilities", @@ -16259,6 +19615,24 @@ } }, "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": "Add + provision an email domain", @@ -16269,7 +19643,7 @@ }, "/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.", + "description": "Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending domain, 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": [ { @@ -16282,6 +19656,24 @@ "responses": { "204": { "description": "Successful Response" + }, + "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": "Revert to the shared agent.seclai.com sending domain", @@ -16332,6 +19724,24 @@ } }, "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": "Remove an email domain", @@ -16402,6 +19812,24 @@ } }, "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": "DMARC aggregate-report summary for a domain", @@ -16412,7 +19840,7 @@ }, "/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.", + "description": "Promote a verified domain to the account's primary domain \u2014 agent email then sends FROM this domain and shows its addresses on it (`@`, `@`) instead of the shared `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared form. 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": [ { @@ -16452,9 +19880,27 @@ } }, "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": "Make a verified domain the account's primary sending/inbound domain", + "summary": "Make a verified domain the account's primary sending domain", "tags": [ "email-domains" ] @@ -16502,6 +19948,24 @@ } }, "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": "Send a test email from a verified domain to the account owner", @@ -16552,6 +20016,24 @@ } }, "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": "Run a verification check immediately ('Check now')", @@ -16608,6 +20090,24 @@ } }, "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": "Generate a governance plan", @@ -16669,6 +20169,24 @@ } }, "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 AI assistant conversations", @@ -16725,6 +20243,24 @@ } }, "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": "Accept a governance plan", @@ -16772,8 +20308,26 @@ "$ref": "#/components/schemas/HTTPValidationError" } } - }, - "description": "Validation Error" + }, + "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": "Decline a governance plan", @@ -16866,6 +20420,24 @@ } }, "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 Knowledge Bases", @@ -16917,6 +20489,24 @@ } }, "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": "Create Knowledge Base", @@ -16959,6 +20549,24 @@ } }, "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 Knowledge Base", @@ -17006,6 +20614,24 @@ } }, "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 Knowledge Base", @@ -17063,6 +20689,24 @@ } }, "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": "Update Knowledge Base", @@ -17093,6 +20737,24 @@ } }, "description": "Successful Response" + }, + "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 current user identity", @@ -17203,6 +20865,24 @@ } }, "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 Memory Banks", @@ -17251,6 +20931,24 @@ } }, "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": "Create Memory Bank", @@ -17304,6 +21002,24 @@ } }, "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": "Generate a memory bank configuration", @@ -17371,6 +21087,24 @@ } }, "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": "Fetch memory bank AI conversation history", @@ -17431,6 +21165,24 @@ } }, "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": "Accept or decline a memory bank AI suggestion", @@ -17461,6 +21213,24 @@ } }, "description": "Successful Response" + }, + "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 Templates", @@ -17511,6 +21281,24 @@ } }, "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": "Test Compaction Prompt Standalone", @@ -17553,6 +21341,24 @@ } }, "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 Memory Bank", @@ -17600,6 +21406,24 @@ } }, "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 Memory Bank", @@ -17657,6 +21481,24 @@ } }, "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": "Update Memory Bank", @@ -17706,6 +21548,24 @@ } }, "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 Agents Using Bank", @@ -17716,7 +21576,7 @@ }, "/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.", + "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age no longer triggers compaction \u2014 use retention_days to remove entries by age. Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", "parameters": [ { @@ -17755,6 +21615,24 @@ } }, "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": "Compact Memory Bank", @@ -17797,6 +21675,24 @@ } }, "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 Memory Bank Source", @@ -17894,6 +21790,24 @@ } }, "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 Memory Bank Entry Stats", @@ -17951,8 +21865,26 @@ "$ref": "#/components/schemas/HTTPValidationError" } } - }, - "description": "Validation Error" + }, + "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": "Test Compaction Prompt", @@ -17963,7 +21895,7 @@ }, "/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.", + "description": "List the enabled LLM models with full details.\n\nReturns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nA model whose credit rate has not been published yet is omitted, so you are never offered a model that cannot be billed and therefore cannot be run. Such a model may appear later without any other change.\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": [ { @@ -18087,6 +22019,24 @@ } }, "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 Models", @@ -18184,6 +22134,24 @@ } }, "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 Alerts", @@ -18207,6 +22175,24 @@ "responses": { "204": { "description": "Successful Response" + }, + "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": "Mark All Read", @@ -18237,6 +22223,24 @@ } }, "description": "Successful Response" + }, + "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 Alert Unread Count", @@ -18280,6 +22284,24 @@ } }, "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": "Mark Read", @@ -18288,6 +22310,82 @@ ] } }, + "/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.", + "operationId": "list_embedding_models_api_models_embedders_get", + "parameters": [ + { + "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", + "in": "query", + "name": "supports_input_media", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", + "title": "Supports Input Media" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbeddingModelListResponse" + } + } + }, + "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 Embedding Models", + "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.", @@ -18310,6 +22408,24 @@ } }, "description": "Successful Response" + }, + "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 Generation Tiers", @@ -18320,7 +22436,7 @@ }, "/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.", + "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 and, when the credential is bound to a user, to that user.", "operationId": "list_experiments_api_models_playground_experiments_get", "parameters": [ { @@ -18429,6 +22545,24 @@ } }, "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 Experiments", @@ -18437,7 +22571,7 @@ ] }, "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.", + "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.\n- When the credential is bound to a user, the experiment belongs to that user; only that user or an account-scoped key can cancel or delete it.", "operationId": "create_experiment_api_models_playground_experiments_post", "parameters": [ { @@ -18477,6 +22611,24 @@ } }, "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": "Create Experiment", @@ -18487,7 +22639,7 @@ }, "/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.", + "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 and, when the credential is bound to a user, to that user; otherwise 404.", "operationId": "delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete", "parameters": [ { @@ -18520,6 +22672,24 @@ } }, "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 Experiment Endpoint", @@ -18528,7 +22698,7 @@ ] }, "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.", + "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 and, when the credential is bound to a user, to that user; otherwise 404.", "operationId": "get_experiment_api_models_playground_experiments__experiment_id__get", "parameters": [ { @@ -18568,6 +22738,24 @@ } }, "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 Experiment", @@ -18578,7 +22766,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.", + "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.", "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", "parameters": [ { @@ -18618,6 +22806,24 @@ } }, "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": "Cancel Experiment Endpoint", @@ -18626,6 +22832,54 @@ ] } }, + "/models/rerankers": { + "get": { + "description": "List the reranker models a knowledge base can be created with.\n\nA reranker re-scores the top results of a vector search for relevance. Each entry carries the `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether it is the platform default (`is_default`, used when you omit `reranker_model`).\n\nTo disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value from this list. Reranking scores text, so a knowledge base whose sources all embed media natively \u2014 whose chunks carry no text \u2014 defaults to no reranker.\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_reranker_models_api_models_rerankers_get", + "parameters": [ + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RerankerModelListResponse" + } + } + }, + "description": "Successful Response" + }, + "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 Reranker Models", + "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.", @@ -18667,6 +22921,24 @@ } }, "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 Model", @@ -18801,11 +23073,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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 Recommendations", @@ -18891,6 +23181,24 @@ } }, "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": "Search resources", @@ -19003,6 +23311,24 @@ } }, "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 solutions", @@ -19051,6 +23377,24 @@ } }, "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": "Create a solution", @@ -19094,6 +23438,24 @@ } }, "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 a solution", @@ -19142,6 +23504,24 @@ } }, "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 a solution", @@ -19200,6 +23580,24 @@ } }, "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": "Update a solution", @@ -19260,6 +23658,24 @@ } }, "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": "Unlink agents", @@ -19318,6 +23734,24 @@ } }, "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": "Link agents", @@ -19378,6 +23812,24 @@ } }, "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": "Generate solution plan", @@ -19438,6 +23890,24 @@ } }, "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": "Generate knowledge base plan", @@ -19498,6 +23968,24 @@ } }, "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": "Generate source plan", @@ -19568,6 +24056,24 @@ } }, "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": "Accept plan", @@ -19621,6 +24127,24 @@ } }, "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": "Decline plan", @@ -19675,6 +24199,24 @@ } }, "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 conversations", @@ -19733,6 +24275,24 @@ } }, "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": "Add conversation turn", @@ -19796,6 +24356,24 @@ } }, "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": "Mark conversation turn", @@ -19856,6 +24434,24 @@ } }, "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": "Unlink knowledge bases", @@ -19914,6 +24510,24 @@ } }, "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": "Link knowledge bases", @@ -19974,6 +24588,24 @@ } }, "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": "Unlink source connections", @@ -20032,6 +24664,24 @@ } }, "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": "Link source connections", @@ -20137,11 +24787,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" } } }, - "description": "Validation Error" + "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 sources", @@ -20193,6 +24861,24 @@ } }, "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": "Create Source", @@ -20236,6 +24922,24 @@ } }, "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 Source", @@ -20284,6 +24988,24 @@ } }, "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 Source", @@ -20292,7 +25014,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- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.", + "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.", "operationId": "upload_inline_text_to_source_api_sources__source_connection_id__post", "parameters": [ { @@ -20300,9 +25022,258 @@ "name": "source_connection_id", "required": true, "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" + "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" + }, + "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": "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" + }, + "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": "Update Source", + "tags": [ + "sources" + ] + } + }, + "/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.", + "operationId": "list_source_contents_api_sources__source_connection_id__contents_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" + } + }, + { + "description": "Sort field (created_at/title/status)", + "in": "query", + "name": "sort", + "required": false, + "schema": { + "default": "created_at", + "description": "Sort field (created_at/title/status)", + "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 to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", + "in": "query", + "name": "status", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", + "title": "Status" + } + }, + { + "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. At most 500 ids per request \u2014 beyond that, page through the unfiltered listing or split the poll.", + "in": "query", + "name": "content_version_id", + "required": false, + "schema": { + "anyOf": [ + { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. At most 500 ids per request \u2014 beyond that, page through the unfiltered listing or split the poll.", + "title": "Content Version Id" } }, { @@ -20312,22 +25283,12 @@ "$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" + "$ref": "#/components/schemas/SourceContentStatusListResponse" } } }, @@ -20342,16 +25303,36 @@ } }, "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 inline text to a content source", + "summary": "List content items and their indexing status", "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", + } + }, + "/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.", + "operationId": "get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get", "parameters": [ { "in": "path", @@ -20363,6 +25344,16 @@ "type": "string" } }, + { + "in": "path", + "name": "content_version_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Content Version Id", + "type": "string" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -20370,22 +25361,12 @@ "$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" + "$ref": "#/components/schemas/SourceContentStatusResponse" } } }, @@ -20400,9 +25381,27 @@ } }, "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": "Update Source", + "summary": "Get one content item's indexing status", "tags": [ "sources" ] @@ -20458,6 +25457,24 @@ } }, "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 Source Embedding Migration", @@ -20519,6 +25536,24 @@ } }, "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": "Start Source Embedding Migration", @@ -20529,7 +25564,7 @@ }, "/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.", + "description": "Cancel an active embedding migration for a custom-index source.\n\nOnly pending and running migrations can be cancelled. A migration that has reached the switching phase is committing its switch-over in a single transaction, so there is no half-applied state to back out of and cancel is refused.", "operationId": "cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post", "parameters": [ { @@ -20569,6 +25604,24 @@ } }, "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": "Cancel Source Embedding Migration", @@ -20642,6 +25695,24 @@ } }, "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 exports", @@ -20650,7 +25721,7 @@ ] }, "post": { - "description": "Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file.", + "description": "Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", "operationId": "create_source_export_api_sources__source_connection_id__exports_post", "parameters": [ { @@ -20691,6 +25762,9 @@ }, "description": "Successful Response" }, + "403": { + "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." + }, "422": { "content": { "application/json": { @@ -20700,6 +25774,24 @@ } }, "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": "Create export", @@ -20760,6 +25852,24 @@ } }, "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": "Estimate export size", @@ -20770,7 +25880,7 @@ }, "/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.", + "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. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", "operationId": "delete_source_export_api_sources__source_connection_id__exports__export_id__delete", "parameters": [ { @@ -20804,6 +25914,9 @@ "204": { "description": "Successful Response" }, + "403": { + "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." + }, "422": { "content": { "application/json": { @@ -20813,6 +25926,24 @@ } }, "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 export", @@ -20871,6 +26002,24 @@ } }, "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 export status", @@ -20881,7 +26030,7 @@ }, "/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.", + "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. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", "operationId": "cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post", "parameters": [ { @@ -20922,6 +26071,9 @@ }, "description": "Successful Response" }, + "403": { + "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." + }, "422": { "content": { "application/json": { @@ -20931,6 +26083,24 @@ } }, "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": "Cancel export", @@ -20989,6 +26159,24 @@ } }, "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": "Download export", @@ -20999,7 +26187,7 @@ }, "/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.", + "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.", "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", "parameters": [ { @@ -21039,6 +26227,9 @@ }, "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": { @@ -21048,6 +26239,24 @@ } }, "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 a file to a content source", @@ -21058,7 +26267,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 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.", + "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.", "operationId": "serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get", "parameters": [ { @@ -21161,6 +26370,24 @@ } }, "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": "Download an agent-run attachment", @@ -21191,6 +26418,24 @@ } }, "description": "Successful Response" + }, + "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 the account's API version", @@ -21239,6 +26484,24 @@ } }, "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": "Pin (or clear) the account's API version", @@ -21260,8 +26523,13 @@ "default": "2026-07-01", "known": [ "2026-07-01", - "2026-07-27" + "2026-07-27", + "2026-08-03", + "2026-08-21", + "2026-09-28", + "2026-09-30", + "2026-10-03" ], - "latest": "2026-07-27" + "latest": "2026-10-03" } } diff --git a/seclai/__init__.py b/seclai/__init__.py index e256d5c..3aab514 100644 --- a/seclai/__init__.py +++ b/seclai/__init__.py @@ -20,6 +20,10 @@ - :class:`SeclaiStreamingError` — SSE stream errors - :class:`AgentRunStreamRequest` — typed request body for streaming runs - :data:`JSONValue` — recursive JSON type alias +- :class:`ApiVersion` — dated API versions this release was built against +- :data:`DEFAULT_API_VERSION` / :data:`LATEST_API_VERSION` — the baseline and + newest known version +- :func:`unwrap_items` — read a version-gated list response in either shape """ from .auth import ( 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 index 637de7c..1295105 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.create_evaluation_criteria_request import CreateEvaluationCriteriaRequest from ...models.evaluation_criteria_response import EvaluationCriteriaResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 201: response_201 = EvaluationCriteriaResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: CreateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Create Evaluation Criteria Create new step evaluation settings for an agent. @@ -101,7 +111,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -125,7 +135,7 @@ def sync( body: CreateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Evaluation Criteria Create new step evaluation settings for an agent. @@ -147,7 +157,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -166,7 +176,9 @@ async def asyncio_detailed( body: CreateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Create Evaluation Criteria Create new step evaluation settings for an agent. @@ -188,7 +200,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -210,7 +222,7 @@ async def asyncio( body: CreateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Evaluation Criteria Create new step evaluation settings for an agent. @@ -232,7 +244,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 9aa25c5..ccbe549 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.create_evaluation_result_request import CreateEvaluationResultRequest from ...models.evaluation_result_response import EvaluationResultResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultResponse | HTTPValidationError | None: +) -> EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 201: response_201 = EvaluationResultResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultResponse | HTTPValidationError]: +) -> Response[EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: CreateEvaluationResultRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultResponse | HTTPValidationError]: +) -> Response[EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError]: """Create Evaluation Result Record an evaluation result for a criteria. @@ -99,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultResponse | HTTPValidationError] + Response[EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +129,7 @@ def sync( body: CreateEvaluationResultRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultResponse | HTTPValidationError | None: +) -> EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Evaluation Result Record an evaluation result for a criteria. @@ -143,7 +149,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultResponse | HTTPValidationError + EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +168,7 @@ async def asyncio_detailed( body: CreateEvaluationResultRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultResponse | HTTPValidationError]: +) -> Response[EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError]: """Create Evaluation Result Record an evaluation result for a criteria. @@ -182,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultResponse | HTTPValidationError] + Response[EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +210,7 @@ async def asyncio( body: CreateEvaluationResultRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultResponse | HTTPValidationError | None: +) -> EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Evaluation Result Record an evaluation result for a criteria. @@ -224,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultResponse | HTTPValidationError + EvaluationResultResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index cd2cf4c..f6c57f6 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Evaluation Criteria Delete an evaluation criteria and all associated evaluation results. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Evaluation Criteria Delete an evaluation criteria and all associated evaluation results. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Evaluation Criteria Delete an evaluation criteria and all associated evaluation results. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Evaluation Criteria Delete an evaluation criteria and all associated evaluation results. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index a2a92ba..ae2315c 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.evaluation_criteria_response import EvaluationCriteriaResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EvaluationCriteriaResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +80,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Get Evaluation Criteria Get a single evaluation criteria by ID. @@ -90,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -112,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Get Evaluation Criteria Get a single evaluation criteria by ID. @@ -130,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,7 +157,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Get Evaluation Criteria Get a single evaluation criteria by ID. @@ -165,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -185,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Get Evaluation Criteria Get a single evaluation criteria by ID. @@ -203,7 +215,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 0c24f4c..7a9f366 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.evaluation_result_summary_response import EvaluationResultSummaryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: +) -> ( + EvaluationResultSummaryResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = EvaluationResultSummaryResponse.from_dict(response.json()) @@ -49,6 +55,11 @@ def _parse_response( 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: @@ -57,7 +68,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultSummaryResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +85,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultSummaryResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError +]: """Get Evaluation Summary Get an aggregated summary of evaluation results for a criteria. @@ -90,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultSummaryResponse | HTTPValidationError] + Response[EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -112,7 +127,12 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: +) -> ( + EvaluationResultSummaryResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Get Evaluation Summary Get an aggregated summary of evaluation results for a criteria. @@ -130,7 +150,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultSummaryResponse | HTTPValidationError + EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,7 +167,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultSummaryResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError +]: """Get Evaluation Summary Get an aggregated summary of evaluation results for a criteria. @@ -165,7 +187,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultSummaryResponse | HTTPValidationError] + Response[EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -185,7 +207,12 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: +) -> ( + EvaluationResultSummaryResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Get Evaluation Summary Get an aggregated summary of evaluation results for a criteria. @@ -203,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultSummaryResponse | HTTPValidationError + EvaluationResultSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 a6d81bd..9bd990a 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 @@ -10,6 +10,7 @@ from ...models.non_manual_evaluation_summary_response import ( NonManualEvaluationSummaryResponse, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -68,7 +69,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: +) -> ( + HTTPValidationError + | NonManualEvaluationSummaryResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = NonManualEvaluationSummaryResponse.from_dict(response.json()) @@ -79,6 +85,11 @@ def _parse_response( 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: @@ -87,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: +) -> Response[ + HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +118,9 @@ def sync_detailed( end_date: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: +) -> Response[ + HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError +]: """Get Non Manual Evaluation Summary Get an evaluation summary for API key clients. @@ -132,7 +147,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | NonManualEvaluationSummaryResponse] + Response[HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -160,7 +175,12 @@ def sync( end_date: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: +) -> ( + HTTPValidationError + | NonManualEvaluationSummaryResponse + | ServiceUnavailableError + | None +): """Get Non Manual Evaluation Summary Get an evaluation summary for API key clients. @@ -187,7 +207,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | NonManualEvaluationSummaryResponse + HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError """ return sync_detailed( @@ -210,7 +230,9 @@ async def asyncio_detailed( end_date: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: +) -> Response[ + HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError +]: """Get Non Manual Evaluation Summary Get an evaluation summary for API key clients. @@ -237,7 +259,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | NonManualEvaluationSummaryResponse] + Response[HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -263,7 +285,12 @@ async def asyncio( end_date: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: +) -> ( + HTTPValidationError + | NonManualEvaluationSummaryResponse + | ServiceUnavailableError + | None +): """Get Non Manual Evaluation Summary Get an evaluation summary for API key clients. @@ -290,7 +317,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | NonManualEvaluationSummaryResponse + HTTPValidationError | NonManualEvaluationSummaryResponse | ServiceUnavailableError """ return ( 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 index 2c5a561..9bdcdc3 100644 --- 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 @@ -11,6 +11,7 @@ EvaluationResultWithCriteriaListResponse, ) from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -86,7 +87,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = EvaluationResultWithCriteriaListResponse.from_dict( response.json() @@ -99,6 +105,11 @@ def _parse_response( 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: @@ -107,7 +118,11 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -129,7 +144,11 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError +]: """List Agent Evaluation Results List evaluation results across all criteria configured on an agent. @@ -154,7 +173,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError] + Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -190,7 +209,12 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """List Agent Evaluation Results List evaluation results across all criteria configured on an agent. @@ -215,7 +239,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultWithCriteriaListResponse | HTTPValidationError + EvaluationResultWithCriteriaListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -246,7 +270,11 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError +]: """List Agent Evaluation Results List evaluation results across all criteria configured on an agent. @@ -271,7 +299,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError] + Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -305,7 +333,12 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultWithCriteriaListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """List Agent Evaluation Results List evaluation results across all criteria configured on an agent. @@ -330,7 +363,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultWithCriteriaListResponse | HTTPValidationError + EvaluationResultWithCriteriaListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index c3bf3dc..5db08d3 100644 --- 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 @@ -10,6 +10,7 @@ from ...client import AuthenticatedClient, Client from ...models.compatible_run_list_response import CompatibleRunListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -60,7 +61,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompatibleRunListResponse | HTTPValidationError | None: +) -> CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CompatibleRunListResponse.from_dict(response.json()) @@ -71,6 +72,11 @@ def _parse_response( 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: @@ -79,7 +85,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompatibleRunListResponse | HTTPValidationError]: +) -> Response[ + CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +105,9 @@ def sync_detailed( started_after: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompatibleRunListResponse | HTTPValidationError]: +) -> Response[ + CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Compatible Runs List agent runs that have a completed step matching the criteria's target step. @@ -118,7 +128,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompatibleRunListResponse | HTTPValidationError] + Response[CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -146,7 +156,7 @@ def sync( started_after: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompatibleRunListResponse | HTTPValidationError | None: +) -> CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError | None: """List Compatible Runs List agent runs that have a completed step matching the criteria's target step. @@ -167,7 +177,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompatibleRunListResponse | HTTPValidationError + CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -190,7 +200,9 @@ async def asyncio_detailed( started_after: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompatibleRunListResponse | HTTPValidationError]: +) -> Response[ + CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Compatible Runs List agent runs that have a completed step matching the criteria's target step. @@ -211,7 +223,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompatibleRunListResponse | HTTPValidationError] + Response[CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -237,7 +249,7 @@ async def asyncio( started_after: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompatibleRunListResponse | HTTPValidationError | None: +) -> CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError | None: """List Compatible Runs List agent runs that have a completed step matching the criteria's target step. @@ -258,7 +270,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompatibleRunListResponse | HTTPValidationError + CompatibleRunListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 6b73a46..9588c72 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.evaluation_criteria_response import EvaluationCriteriaResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -49,7 +50,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationCriteriaResponse] + | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -67,6 +73,11 @@ def _parse_response( 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: @@ -75,7 +86,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +105,9 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse] +]: """List Evaluation Criteria List evaluation criteria configured for an agent. @@ -121,7 +136,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[EvaluationCriteriaResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse]] """ kwargs = _get_kwargs( @@ -147,7 +162,12 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationCriteriaResponse] + | None +): """List Evaluation Criteria List evaluation criteria configured for an agent. @@ -176,7 +196,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[EvaluationCriteriaResponse] + HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse] """ return sync_detailed( @@ -197,7 +217,9 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse] +]: """List Evaluation Criteria List evaluation criteria configured for an agent. @@ -226,7 +248,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[EvaluationCriteriaResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse]] """ kwargs = _get_kwargs( @@ -250,7 +272,12 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationCriteriaResponse] + | None +): """List Evaluation Criteria List evaluation criteria configured for an agent. @@ -279,7 +306,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[EvaluationCriteriaResponse] + HTTPValidationError | ServiceUnavailableError | list[EvaluationCriteriaResponse] """ return ( 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 index 18c8999..25d951c 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.evaluation_result_list_response import EvaluationResultListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -76,7 +77,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = EvaluationResultListResponse.from_dict(response.json()) @@ -87,6 +90,11 @@ def _parse_response( 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: @@ -95,7 +103,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -116,7 +126,9 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Evaluation Results List evaluation results for a criteria with optional filtering. @@ -141,7 +153,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultListResponse | HTTPValidationError] + Response[EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -175,7 +187,9 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List Evaluation Results List evaluation results for a criteria with optional filtering. @@ -200,7 +214,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultListResponse | HTTPValidationError + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -229,7 +243,9 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultListResponse | HTTPValidationError]: +) -> Response[ + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Evaluation Results List evaluation results for a criteria with optional filtering. @@ -254,7 +270,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationResultListResponse | HTTPValidationError] + Response[EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -286,7 +302,9 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationResultListResponse | HTTPValidationError | None: +) -> ( + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List Evaluation Results List evaluation results for a criteria with optional filtering. @@ -311,7 +329,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationResultListResponse | HTTPValidationError + EvaluationResultListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 68f8ea3..8516f41 100644 --- 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 @@ -11,6 +11,7 @@ EvaluationRunSummaryListResponse, ) from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -83,7 +84,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: +) -> ( + EvaluationRunSummaryListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = EvaluationRunSummaryListResponse.from_dict(response.json()) @@ -94,6 +100,11 @@ def _parse_response( 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: @@ -102,7 +113,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationRunSummaryListResponse | HTTPValidationError]: +) -> Response[ + EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -123,7 +136,9 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationRunSummaryListResponse | HTTPValidationError]: +) -> Response[ + EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Evaluation Runs List evaluation results grouped by agent run. @@ -147,7 +162,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationRunSummaryListResponse | HTTPValidationError] + Response[EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -181,7 +196,12 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: +) -> ( + EvaluationRunSummaryListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """List Evaluation Runs List evaluation results grouped by agent run. @@ -205,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationRunSummaryListResponse | HTTPValidationError + EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -234,7 +254,9 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationRunSummaryListResponse | HTTPValidationError]: +) -> Response[ + EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError +]: """List Evaluation Runs List evaluation results grouped by agent run. @@ -258,7 +280,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationRunSummaryListResponse | HTTPValidationError] + Response[EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -290,7 +312,12 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: +) -> ( + EvaluationRunSummaryListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """List Evaluation Runs List evaluation results grouped by agent run. @@ -314,7 +341,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationRunSummaryListResponse | HTTPValidationError + EvaluationRunSummaryListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 38485cc..44131b3 100644 --- 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 @@ -11,6 +11,7 @@ EvaluationResultWithCriteriaResponse, ) from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -53,7 +54,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] + | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -71,6 +77,11 @@ def _parse_response( 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: @@ -79,7 +90,11 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +112,11 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] +]: """List Run Evaluation Results List evaluation results recorded for a specific agent run. @@ -126,7 +145,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[EvaluationResultWithCriteriaResponse]] """ kwargs = _get_kwargs( @@ -154,7 +173,12 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] + | None +): """List Run Evaluation Results List evaluation results recorded for a specific agent run. @@ -183,7 +207,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[EvaluationResultWithCriteriaResponse] + HTTPValidationError | ServiceUnavailableError | list[EvaluationResultWithCriteriaResponse] """ return sync_detailed( @@ -206,7 +230,11 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] +]: """List Run Evaluation Results List evaluation results recorded for a specific agent run. @@ -235,7 +263,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[EvaluationResultWithCriteriaResponse]] """ kwargs = _get_kwargs( @@ -261,7 +289,12 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[EvaluationResultWithCriteriaResponse] + | None +): """List Run Evaluation Results List evaluation results recorded for a specific agent run. @@ -290,7 +323,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[EvaluationResultWithCriteriaResponse] + HTTPValidationError | ServiceUnavailableError | list[EvaluationResultWithCriteriaResponse] """ return ( 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 085008e..63b845d 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.test_draft_evaluation_request import TestDraftEvaluationRequest from ...models.test_draft_evaluation_response import TestDraftEvaluationResponse from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | TestDraftEvaluationResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse | None: if response.status_code == 200: response_200 = TestDraftEvaluationResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,14 +87,16 @@ def sync_detailed( body: TestDraftEvaluationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | 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. + configurations while editing criteria. The evaluation is a billed LLM + call; only its result goes unrecorded. Args: agent_id (str): @@ -103,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | TestDraftEvaluationResponse] + Response[HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse] """ kwargs = _get_kwargs( @@ -127,14 +137,14 @@ def sync( body: TestDraftEvaluationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | TestDraftEvaluationResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | 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. + configurations while editing criteria. The evaluation is a billed LLM + call; only its result goes unrecorded. Args: agent_id (str): @@ -151,7 +161,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | TestDraftEvaluationResponse + HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse """ return sync_detailed( @@ -170,14 +180,16 @@ async def asyncio_detailed( body: TestDraftEvaluationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | 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. + configurations while editing criteria. The evaluation is a billed LLM + call; only its result goes unrecorded. Args: agent_id (str): @@ -194,7 +206,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | TestDraftEvaluationResponse] + Response[HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse] """ kwargs = _get_kwargs( @@ -216,14 +228,14 @@ async def asyncio( body: TestDraftEvaluationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | TestDraftEvaluationResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | 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. + configurations while editing criteria. The evaluation is a billed LLM + call; only its result goes unrecorded. Args: agent_id (str): @@ -240,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | TestDraftEvaluationResponse + HTTPValidationError | ServiceUnavailableError | TestDraftEvaluationResponse """ return ( 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 index 3d55150..4b4c456 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.evaluation_criteria_response import EvaluationCriteriaResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_evaluation_criteria_request import UpdateEvaluationCriteriaRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EvaluationCriteriaResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: UpdateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Update Evaluation Criteria Update an evaluation criteria. @@ -101,7 +111,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -125,7 +135,7 @@ def sync( body: UpdateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Update Evaluation Criteria Update an evaluation criteria. @@ -147,7 +157,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -166,7 +176,9 @@ async def asyncio_detailed( body: UpdateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: +) -> Response[ + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError +]: """Update Evaluation Criteria Update an evaluation criteria. @@ -188,7 +200,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EvaluationCriteriaResponse | HTTPValidationError] + Response[EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -210,7 +222,7 @@ async def asyncio( body: UpdateEvaluationCriteriaRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: +) -> EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError | None: """Update Evaluation Criteria Update an evaluation criteria. @@ -232,7 +244,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EvaluationCriteriaResponse | HTTPValidationError + EvaluationCriteriaResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 e232195..b6b0f94 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 @@ -9,6 +9,7 @@ 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 @@ -53,7 +54,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> File | HTTPValidationError | None: +) -> File | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = File(payload=BytesIO(response.content)) @@ -64,6 +65,11 @@ def _parse_response( 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: @@ -72,7 +78,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[File | HTTPValidationError]: +) -> Response[File | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,18 +95,18 @@ def sync_detailed( download_name: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[File | HTTPValidationError]: +) -> 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 URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). + 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. - 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. + 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. MIME handling: - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, @@ -120,7 +126,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[File | HTTPValidationError] + Response[File | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -146,18 +152,18 @@ def sync( download_name: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> File | HTTPValidationError | None: +) -> 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 URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). + 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. - 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. + 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. MIME handling: - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, @@ -177,7 +183,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - File | HTTPValidationError + File | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -198,18 +204,18 @@ async def asyncio_detailed( download_name: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[File | HTTPValidationError]: +) -> 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 URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). + 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. - 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. + 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. MIME handling: - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, @@ -229,7 +235,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[File | HTTPValidationError] + Response[File | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -253,18 +259,18 @@ async def asyncio( download_name: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> File | HTTPValidationError | None: +) -> 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 URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). + 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. - 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. + 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. MIME handling: - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, @@ -284,7 +290,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - File | HTTPValidationError + File | HTTPValidationError | ServiceUnavailableError """ return ( 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 80625a3..8a21071 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_attachment_refs_api_response import AgentAttachmentRefsApiResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: +) -> ( + AgentAttachmentRefsApiResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = AgentAttachmentRefsApiResponse.from_dict(response.json()) @@ -49,6 +55,11 @@ def _parse_response( 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: @@ -57,7 +68,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentAttachmentRefsApiResponse | HTTPValidationError]: +) -> Response[ + AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +85,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentAttachmentRefsApiResponse | HTTPValidationError]: +) -> Response[ + AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError +]: """Get agent attachment-reference contract Return the static attachment-reference contract for an agent — what files the agent's definition @@ -92,7 +107,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentAttachmentRefsApiResponse | HTTPValidationError] + Response[AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +129,12 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: +) -> ( + AgentAttachmentRefsApiResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Get agent attachment-reference contract Return the static attachment-reference contract for an agent — what files the agent's definition @@ -134,7 +154,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentAttachmentRefsApiResponse | HTTPValidationError + AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -151,7 +171,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentAttachmentRefsApiResponse | HTTPValidationError]: +) -> Response[ + AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError +]: """Get agent attachment-reference contract Return the static attachment-reference contract for an agent — what files the agent's definition @@ -171,7 +193,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentAttachmentRefsApiResponse | HTTPValidationError] + Response[AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +213,12 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: +) -> ( + AgentAttachmentRefsApiResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Get agent attachment-reference contract Return the static attachment-reference contract for an agent — what files the agent's definition @@ -211,7 +238,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentAttachmentRefsApiResponse | HTTPValidationError + AgentAttachmentRefsApiResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index fbc5296..fda68c6 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.upload_agent_input_api_response import UploadAgentInputApiResponse from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: if response.status_code == 200: response_200 = UploadAgentInputApiResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,7 +83,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: """Get upload status Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. @@ -97,7 +107,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | UploadAgentInputApiResponse] + Response[HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse] """ kwargs = _get_kwargs( @@ -121,7 +131,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Get upload status Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. @@ -143,7 +153,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | UploadAgentInputApiResponse + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse """ return sync_detailed( @@ -162,7 +172,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: """Get upload status Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. @@ -184,7 +196,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | UploadAgentInputApiResponse] + Response[HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse] """ kwargs = _get_kwargs( @@ -206,7 +218,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Get upload status Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. @@ -228,7 +240,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | UploadAgentInputApiResponse + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse """ return ( 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 13d2be3..a37b599 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.upload_agent_input_api_response import UploadAgentInputApiResponse from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: if response.status_code == 202: response_202 = UploadAgentInputApiResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +80,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: """Upload file input Upload a file to use as input for a `dynamic_input` agent run. @@ -109,7 +119,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | UploadAgentInputApiResponse] + Response[HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse] """ kwargs = _get_kwargs( @@ -131,7 +141,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Upload file input Upload a file to use as input for a `dynamic_input` agent run. @@ -168,7 +178,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | UploadAgentInputApiResponse + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse """ return sync_detailed( @@ -185,7 +195,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse +]: """Upload file input Upload a file to use as input for a `dynamic_input` agent run. @@ -222,7 +234,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | UploadAgentInputApiResponse] + Response[HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse] """ kwargs = _get_kwargs( @@ -242,7 +254,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Upload file input Upload a file to use as input for a `dynamic_input` agent run. @@ -279,7 +291,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | UploadAgentInputApiResponse + HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse """ return ( 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 index ca6e931..de4ad04 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.block_email_sender_request import BlockEmailSenderRequest from ...models.blocked_email_sender_response import BlockedEmailSenderResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderResponse | HTTPValidationError | None: +) -> BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 201: response_201 = BlockedEmailSenderResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: BlockEmailSenderRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError +]: """Block an inbound email sender or domain Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is @@ -94,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderResponse | HTTPValidationError] + Response[BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +126,7 @@ def sync( body: BlockEmailSenderRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderResponse | HTTPValidationError | None: +) -> BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError | None: """Block an inbound email sender or domain Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is @@ -136,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderResponse | HTTPValidationError + BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +163,9 @@ async def asyncio_detailed( body: BlockEmailSenderRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError +]: """Block an inbound email sender or domain Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is @@ -173,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderResponse | HTTPValidationError] + Response[BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -193,7 +205,7 @@ async def asyncio( body: BlockEmailSenderRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderResponse | HTTPValidationError | None: +) -> BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError | None: """Block an inbound email sender or domain Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is @@ -213,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderResponse | HTTPValidationError + BlockedEmailSenderResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index dcc7889..0d4b57a 100644 --- 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 @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.cancel_queued_runs_response import CancelQueuedRunsResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelQueuedRunsResponse | None: +) -> CancelQueuedRunsResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CancelQueuedRunsResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelQueuedRunsResponse]: +) -> Response[CancelQueuedRunsResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,11 +67,11 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CancelQueuedRunsResponse]: +) -> Response[CancelQueuedRunsResponse | ServiceUnavailableError]: """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. + Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has + consumed no quota, 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. @@ -79,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelQueuedRunsResponse] + Response[CancelQueuedRunsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -99,11 +105,11 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CancelQueuedRunsResponse | None: +) -> CancelQueuedRunsResponse | ServiceUnavailableError | 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. + Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has + consumed no quota, 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. @@ -117,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelQueuedRunsResponse + CancelQueuedRunsResponse | ServiceUnavailableError """ return sync_detailed( @@ -132,11 +138,11 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CancelQueuedRunsResponse]: +) -> Response[CancelQueuedRunsResponse | ServiceUnavailableError]: """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. + Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has + consumed no quota, 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. @@ -150,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelQueuedRunsResponse] + Response[CancelQueuedRunsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -168,11 +174,11 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CancelQueuedRunsResponse | None: +) -> CancelQueuedRunsResponse | ServiceUnavailableError | 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. + Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has + consumed no quota, 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. @@ -186,7 +192,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelQueuedRunsResponse + CancelQueuedRunsResponse | ServiceUnavailableError """ return ( 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 a978912..88f706c 100644 --- a/seclai/_generated/api/agents/create_agent_api_agents_post.py +++ b/seclai/_generated/api/agents/create_agent_api_agents_post.py @@ -11,6 +11,7 @@ ) from ...models.agent_summary_response import AgentSummaryResponse from ...models.create_agent_request import CreateAgentRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -42,7 +43,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError + | None +): if response.status_code == 201: response_201 = AgentSummaryResponse.from_dict(response.json()) @@ -57,6 +64,11 @@ def _parse_response( 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: @@ -65,7 +77,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +97,12 @@ def sync_detailed( body: CreateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError +]: """Create an agent Create a new agent. @@ -117,7 +139,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any] + Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -139,7 +161,13 @@ def sync( body: CreateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError + | None +): """Create an agent Create a new agent. @@ -176,7 +204,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any + AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | ServiceUnavailableError """ return sync_detailed( @@ -193,7 +221,12 @@ async def asyncio_detailed( body: CreateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError +]: """Create an agent Create a new agent. @@ -230,7 +263,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any] + Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -250,7 +283,13 @@ async def asyncio( body: CreateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | Any + | ServiceUnavailableError + | None +): """Create an agent Create a new agent. @@ -287,7 +326,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any + AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | ServiceUnavailableError """ return ( 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 index 9e82f92..42f5e66 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete an agent Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. @@ -89,7 +95,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -111,7 +117,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete an agent Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. @@ -130,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,7 +153,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete an agent Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. @@ -166,7 +172,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -186,7 +192,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete an agent Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 29e6391..e0f23c2 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_run_response import AgentRunResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentRunResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,13 +78,13 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: """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. + dispatched; it has consumed no quota. If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. @@ -96,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError] + Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -118,13 +124,13 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | 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. + dispatched; it has consumed no quota. If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. @@ -142,7 +148,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError + AgentRunResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -159,13 +165,13 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: """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. + dispatched; it has consumed no quota. If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. @@ -183,7 +189,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError] + Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -203,13 +209,13 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | 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. + dispatched; it has consumed no quota. If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. @@ -227,7 +233,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError + AgentRunResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index eaa360b..0f0ad5e 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_summary_response import AgentSummaryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentSummaryResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Pause (disable) an agent Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is @@ -94,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Pause (disable) an agent Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is @@ -138,7 +144,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +161,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Pause (disable) an agent Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is @@ -177,7 +183,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -197,7 +203,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Pause (disable) an agent Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is @@ -219,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 1820aa6..dd3c8de 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_summary_response import AgentSummaryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentSummaryResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Resume (enable) a paused agent Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Resume (enable) a paused agent Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Resume (enable) a paused agent Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Resume (enable) a paused agent Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index a42e34d..546fbf9 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_export_response import AgentExportResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,7 +47,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentExportResponse | HTTPValidationError | None: +) -> AgentExportResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentExportResponse.from_dict(response.json()) @@ -57,6 +58,11 @@ def _parse_response( 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: @@ -65,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentExportResponse | HTTPValidationError]: +) -> Response[AgentExportResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,7 +87,7 @@ def sync_detailed( download: bool | Unset = True, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentExportResponse | HTTPValidationError]: +) -> Response[AgentExportResponse | HTTPValidationError | ServiceUnavailableError]: r"""Export agent definition Export an agent definition as a portable JSON snapshot. @@ -91,7 +97,7 @@ def sync_detailed( every referenced external entity UUID to its human-readable name. Response shape: - - `export_version`: schema version (currently `\"2\"`) + - `export_version`: schema version (currently `\"5\"`) - `exported_at`: ISO-8601 timestamp - `agent`: name, description, schema_version, definition, timestamps - `trigger`: trigger type, input template, schedules @@ -118,7 +124,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentExportResponse | HTTPValidationError] + Response[AgentExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -142,7 +148,7 @@ def sync( download: bool | Unset = True, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentExportResponse | HTTPValidationError | None: +) -> AgentExportResponse | HTTPValidationError | ServiceUnavailableError | None: r"""Export agent definition Export an agent definition as a portable JSON snapshot. @@ -152,7 +158,7 @@ def sync( every referenced external entity UUID to its human-readable name. Response shape: - - `export_version`: schema version (currently `\"2\"`) + - `export_version`: schema version (currently `\"5\"`) - `exported_at`: ISO-8601 timestamp - `agent`: name, description, schema_version, definition, timestamps - `trigger`: trigger type, input template, schedules @@ -179,7 +185,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentExportResponse | HTTPValidationError + AgentExportResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -198,7 +204,7 @@ async def asyncio_detailed( download: bool | Unset = True, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentExportResponse | HTTPValidationError]: +) -> Response[AgentExportResponse | HTTPValidationError | ServiceUnavailableError]: r"""Export agent definition Export an agent definition as a portable JSON snapshot. @@ -208,7 +214,7 @@ async def asyncio_detailed( every referenced external entity UUID to its human-readable name. Response shape: - - `export_version`: schema version (currently `\"2\"`) + - `export_version`: schema version (currently `\"5\"`) - `exported_at`: ISO-8601 timestamp - `agent`: name, description, schema_version, definition, timestamps - `trigger`: trigger type, input template, schedules @@ -235,7 +241,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentExportResponse | HTTPValidationError] + Response[AgentExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -257,7 +263,7 @@ async def asyncio( download: bool | Unset = True, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentExportResponse | HTTPValidationError | None: +) -> AgentExportResponse | HTTPValidationError | ServiceUnavailableError | None: r"""Export agent definition Export an agent definition as a portable JSON snapshot. @@ -267,7 +273,7 @@ async def asyncio( every referenced external entity UUID to its human-readable name. Response shape: - - `export_version`: schema version (currently `\"2\"`) + - `export_version`: schema version (currently `\"5\"`) - `exported_at`: ISO-8601 timestamp - `agent`: name, description, schema_version, definition, timestamps - `trigger`: trigger type, input template, schedules @@ -294,7 +300,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentExportResponse | HTTPValidationError + AgentExportResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index ca2dfa0..1576721 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.generate_agent_steps_request import GenerateAgentStepsRequest from ...models.generate_agent_steps_response import GenerateAgentStepsResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerateAgentStepsResponse | HTTPValidationError | None: +) -> GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = GenerateAgentStepsResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerateAgentStepsResponse | HTTPValidationError]: +) -> Response[ + GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: GenerateAgentStepsRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerateAgentStepsResponse | HTTPValidationError]: +) -> Response[ + GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate agent workflow Use the AI assistant to generate a full agent step workflow from a natural language description. @@ -103,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateAgentStepsResponse | HTTPValidationError] + Response[GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -127,7 +137,7 @@ def sync( body: GenerateAgentStepsRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerateAgentStepsResponse | HTTPValidationError | None: +) -> GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate agent workflow Use the AI assistant to generate a full agent step workflow from a natural language description. @@ -151,7 +161,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateAgentStepsResponse | HTTPValidationError + GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -170,7 +180,9 @@ async def asyncio_detailed( body: GenerateAgentStepsRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerateAgentStepsResponse | HTTPValidationError]: +) -> Response[ + GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate agent workflow Use the AI assistant to generate a full agent step workflow from a natural language description. @@ -194,7 +206,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateAgentStepsResponse | HTTPValidationError] + Response[GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -216,7 +228,7 @@ async def asyncio( body: GenerateAgentStepsRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerateAgentStepsResponse | HTTPValidationError | None: +) -> GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate agent workflow Use the AI assistant to generate a full agent step workflow from a natural language description. @@ -240,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateAgentStepsResponse | HTTPValidationError + GenerateAgentStepsResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 50165af..4095bad 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.generate_step_config_request import GenerateStepConfigRequest from ...models.generate_step_config_response import GenerateStepConfigResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerateStepConfigResponse | HTTPValidationError | None: +) -> GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = GenerateStepConfigResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerateStepConfigResponse | HTTPValidationError]: +) -> Response[ + GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: GenerateStepConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerateStepConfigResponse | HTTPValidationError]: +) -> Response[ + GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate step configuration Use the AI assistant to generate or refine a single step's configuration. @@ -103,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateStepConfigResponse | HTTPValidationError] + Response[GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -127,7 +137,7 @@ def sync( body: GenerateStepConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerateStepConfigResponse | HTTPValidationError | None: +) -> GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate step configuration Use the AI assistant to generate or refine a single step's configuration. @@ -151,7 +161,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateStepConfigResponse | HTTPValidationError + GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -170,7 +180,9 @@ async def asyncio_detailed( body: GenerateStepConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerateStepConfigResponse | HTTPValidationError]: +) -> Response[ + GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate step configuration Use the AI assistant to generate or refine a single step's configuration. @@ -194,7 +206,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateStepConfigResponse | HTTPValidationError] + Response[GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -216,7 +228,7 @@ async def asyncio( body: GenerateStepConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerateStepConfigResponse | HTTPValidationError | None: +) -> GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate step configuration Use the AI assistant to generate or refine a single step's configuration. @@ -240,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateStepConfigResponse | HTTPValidationError + GenerateStepConfigResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index a92d5ca..37b8c84 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_caller_api_response import AgentCallerApiResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse] | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -54,6 +57,11 @@ def _parse_response( 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: @@ -62,7 +70,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +87,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | 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 @@ -96,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[AgentCallerApiResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse]] """ kwargs = _get_kwargs( @@ -118,7 +130,9 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | 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 @@ -137,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[AgentCallerApiResponse] + HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse] """ return sync_detailed( @@ -154,7 +168,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | 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 @@ -173,7 +189,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[AgentCallerApiResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse]] """ kwargs = _get_kwargs( @@ -193,7 +209,9 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | 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 @@ -212,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[AgentCallerApiResponse] + HTTPValidationError | ServiceUnavailableError | list[AgentCallerApiResponse] """ return ( 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 index e521176..6eba31f 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_definition_response import AgentDefinitionResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionResponse | HTTPValidationError | None: +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentDefinitionResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionResponse | HTTPValidationError]: +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,8 +78,8 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Get agent definition +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: + r"""Get agent definition Fetch the current agent definition from the main branch. @@ -112,7 +118,10 @@ def sync_detailed( 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) + time streaming). To stream **and** return a schema-validated payload, add a sibling branch + `extract_content` (`expected_format: \"json\"` + `json_schema`) → `display_result` under the same + `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes + first, so its validated output becomes the run's result while the tokens act as a progress channel - `display_result`: Show output to the user - `join`: Merge parallel branches - `merge`: Combine multiple inputs into a single templated output @@ -145,7 +154,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionResponse | HTTPValidationError] + Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -167,8 +176,8 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Get agent definition +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: + r"""Get agent definition Fetch the current agent definition from the main branch. @@ -207,7 +216,10 @@ def sync( 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) + time streaming). To stream **and** return a schema-validated payload, add a sibling branch + `extract_content` (`expected_format: \"json\"` + `json_schema`) → `display_result` under the same + `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes + first, so its validated output becomes the run's result while the tokens act as a progress channel - `display_result`: Show output to the user - `join`: Merge parallel branches - `merge`: Combine multiple inputs into a single templated output @@ -240,7 +252,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionResponse | HTTPValidationError + AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -257,8 +269,8 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Get agent definition +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: + r"""Get agent definition Fetch the current agent definition from the main branch. @@ -297,7 +309,10 @@ async def asyncio_detailed( 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) + time streaming). To stream **and** return a schema-validated payload, add a sibling branch + `extract_content` (`expected_format: \"json\"` + `json_schema`) → `display_result` under the same + `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes + first, so its validated output becomes the run's result while the tokens act as a progress channel - `display_result`: Show output to the user - `join`: Merge parallel branches - `merge`: Combine multiple inputs into a single templated output @@ -330,7 +345,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionResponse | HTTPValidationError] + Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -350,8 +365,8 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Get agent definition +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: + r"""Get agent definition Fetch the current agent definition from the main branch. @@ -390,7 +405,10 @@ async def asyncio( 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) + time streaming). To stream **and** return a schema-validated payload, add a sibling branch + `extract_content` (`expected_format: \"json\"` + `json_schema`) → `display_result` under the same + `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes + first, so its validated output becomes the run's result while the tokens act as a progress channel - `display_result`: Show output to the user - `join`: Merge parallel branches - `merge`: Combine multiple inputs into a single templated output @@ -423,7 +441,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionResponse | HTTPValidationError + AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d482020..713533a 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_summary_response import AgentSummaryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentSummaryResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Get an agent Fetch an agent's metadata (name, description, trigger type, timestamps). @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Get an agent Fetch an agent's metadata (name, description, trigger type, timestamps). @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: +) -> Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """Get an agent Fetch an agent's metadata (name, description, trigger type, timestamps). @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentSummaryResponse | HTTPValidationError] + Response[AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: +) -> AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """Get an agent Fetch an agent's metadata (name, description, trigger type, timestamps). @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentSummaryResponse | HTTPValidationError + AgentSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 2dc985c..42efd6e 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_run_response import AgentRunResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,7 +47,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentRunResponse.from_dict(response.json()) @@ -57,6 +58,11 @@ def _parse_response( 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: @@ -65,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,7 +87,7 @@ def sync_detailed( include_step_outputs: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: """Get an agent run Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST @@ -106,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError] + Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -130,7 +136,7 @@ def sync( include_step_outputs: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | None: """Get an agent run Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST @@ -155,7 +161,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError + AgentRunResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -174,7 +180,7 @@ async def asyncio_detailed( include_step_outputs: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: +) -> Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError]: """Get an agent run Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST @@ -199,7 +205,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError] + Response[AgentRunResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -221,7 +227,7 @@ async def asyncio( include_step_outputs: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: +) -> AgentRunResponse | HTTPValidationError | ServiceUnavailableError | None: """Get an agent run Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST @@ -246,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError + AgentRunResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 32bddca..6fd0614 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.ai_conversation_history_response import AiConversationHistoryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -60,7 +61,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiConversationHistoryResponse | HTTPValidationError | None: +) -> ( + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = AiConversationHistoryResponse.from_dict(response.json()) @@ -71,6 +74,11 @@ def _parse_response( 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: @@ -79,7 +87,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiConversationHistoryResponse | HTTPValidationError]: +) -> Response[ + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -98,7 +108,9 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiConversationHistoryResponse | HTTPValidationError]: +) -> Response[ + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError +]: """Get AI conversation history Fetch the AI assistant conversation history for a specific step of an agent. @@ -125,7 +137,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiConversationHistoryResponse | HTTPValidationError] + Response[AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -155,7 +167,9 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiConversationHistoryResponse | HTTPValidationError | None: +) -> ( + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError | None +): """Get AI conversation history Fetch the AI assistant conversation history for a specific step of an agent. @@ -182,7 +196,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiConversationHistoryResponse | HTTPValidationError + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -207,7 +221,9 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiConversationHistoryResponse | HTTPValidationError]: +) -> Response[ + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError +]: """Get AI conversation history Fetch the AI assistant conversation history for a specific step of an agent. @@ -234,7 +250,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiConversationHistoryResponse | HTTPValidationError] + Response[AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -262,7 +278,9 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiConversationHistoryResponse | HTTPValidationError | None: +) -> ( + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError | None +): """Get AI conversation history Fetch the AI assistant conversation history for a specific step of an agent. @@ -289,7 +307,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiConversationHistoryResponse | HTTPValidationError + AiConversationHistoryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index cb167ff..d50b8ad 100644 --- 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 @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.inbound_email_status_response import InboundEmailStatusResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> InboundEmailStatusResponse | None: +) -> InboundEmailStatusResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = InboundEmailStatusResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[InboundEmailStatusResponse]: +) -> Response[InboundEmailStatusResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[InboundEmailStatusResponse]: +) -> Response[InboundEmailStatusResponse | ServiceUnavailableError]: """Account inbound-email overload status Whether the account-wide overload circuit breaker has currently paused new inbound email (all @@ -80,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[InboundEmailStatusResponse] + Response[InboundEmailStatusResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -100,7 +106,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> InboundEmailStatusResponse | None: +) -> InboundEmailStatusResponse | ServiceUnavailableError | None: """Account inbound-email overload status Whether the account-wide overload circuit breaker has currently paused new inbound email (all @@ -119,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - InboundEmailStatusResponse + InboundEmailStatusResponse | ServiceUnavailableError """ return sync_detailed( @@ -134,7 +140,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[InboundEmailStatusResponse]: +) -> Response[InboundEmailStatusResponse | ServiceUnavailableError]: """Account inbound-email overload status Whether the account-wide overload circuit breaker has currently paused new inbound email (all @@ -153,7 +159,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[InboundEmailStatusResponse] + Response[InboundEmailStatusResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -171,7 +177,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> InboundEmailStatusResponse | None: +) -> InboundEmailStatusResponse | ServiceUnavailableError | None: """Account inbound-email overload status Whether the account-wide overload circuit breaker has currently paused new inbound email (all @@ -190,7 +196,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - InboundEmailStatusResponse + InboundEmailStatusResponse | ServiceUnavailableError """ return ( 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 index b6ba477..c9a3fb1 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_email_opt_out_list_response import AgentEmailOptOutListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -53,7 +54,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: +) -> ( + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = AgentEmailOptOutListResponse.from_dict(response.json()) @@ -64,6 +67,11 @@ def _parse_response( 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: @@ -72,7 +80,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentEmailOptOutListResponse | HTTPValidationError]: +) -> Response[ + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,7 +99,9 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentEmailOptOutListResponse | HTTPValidationError]: +) -> Response[ + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError +]: """List agent-email opt-outs List recipients who have opted out of this account's agent emails (filter to one agent via @@ -111,7 +123,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentEmailOptOutListResponse | HTTPValidationError] + Response[AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -137,7 +149,9 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: +) -> ( + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List agent-email opt-outs List recipients who have opted out of this account's agent emails (filter to one agent via @@ -159,7 +173,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentEmailOptOutListResponse | HTTPValidationError + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -180,7 +194,9 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentEmailOptOutListResponse | HTTPValidationError]: +) -> Response[ + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError +]: """List agent-email opt-outs List recipients who have opted out of this account's agent emails (filter to one agent via @@ -202,7 +218,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentEmailOptOutListResponse | HTTPValidationError] + Response[AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -226,7 +242,9 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: +) -> ( + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List agent-email opt-outs List recipients who have opted out of this account's agent emails (filter to one agent via @@ -248,7 +266,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentEmailOptOutListResponse | HTTPValidationError + AgentEmailOptOutListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d5d9f0d..be1c2e7 100644 --- 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 @@ -12,6 +12,7 @@ from ...models.pending_processing_completed_failed_status import ( PendingProcessingCompletedFailedStatus, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -62,7 +63,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunListResponse | HTTPValidationError | None: +) -> AgentRunListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentRunListResponse.from_dict(response.json()) @@ -73,6 +74,11 @@ def _parse_response( 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: @@ -81,7 +87,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunListResponse | HTTPValidationError]: +) -> Response[AgentRunListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -99,7 +105,7 @@ def sync_detailed( status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunListResponse | HTTPValidationError]: +) -> Response[AgentRunListResponse | HTTPValidationError | ServiceUnavailableError]: """List agent runs List runs for a specific agent (most recent first), with pagination. @@ -128,7 +134,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunListResponse | HTTPValidationError] + Response[AgentRunListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -156,7 +162,7 @@ def sync( status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunListResponse | HTTPValidationError | None: +) -> AgentRunListResponse | HTTPValidationError | ServiceUnavailableError | None: """List agent runs List runs for a specific agent (most recent first), with pagination. @@ -185,7 +191,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunListResponse | HTTPValidationError + AgentRunListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -208,7 +214,7 @@ async def asyncio_detailed( status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunListResponse | HTTPValidationError]: +) -> Response[AgentRunListResponse | HTTPValidationError | ServiceUnavailableError]: """List agent runs List runs for a specific agent (most recent first), with pagination. @@ -237,7 +243,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunListResponse | HTTPValidationError] + Response[AgentRunListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -263,7 +269,7 @@ async def asyncio( status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunListResponse | HTTPValidationError | None: +) -> AgentRunListResponse | HTTPValidationError | ServiceUnavailableError | None: """List agent runs List runs for a specific agent (most recent first), with pagination. @@ -292,7 +298,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunListResponse | HTTPValidationError + AgentRunListResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/agents/list_agents_api_agents_get.py b/seclai/_generated/api/agents/list_agents_api_agents_get.py index e82202e..5daa324 100644 --- a/seclai/_generated/api/agents/list_agents_api_agents_get.py +++ b/seclai/_generated/api/agents/list_agents_api_agents_get.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_list_response import AgentListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -45,7 +46,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentListResponse | HTTPValidationError | None: +) -> AgentListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentListResponse.from_dict(response.json()) @@ -56,6 +57,11 @@ def _parse_response( 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: @@ -64,7 +70,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentListResponse | HTTPValidationError]: +) -> Response[AgentListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +86,7 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentListResponse | HTTPValidationError]: +) -> Response[AgentListResponse | HTTPValidationError | ServiceUnavailableError]: """List agents List agents for the account with pagination. @@ -100,7 +106,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentListResponse | HTTPValidationError] + Response[AgentListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -124,7 +130,7 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentListResponse | HTTPValidationError | None: +) -> AgentListResponse | HTTPValidationError | ServiceUnavailableError | None: """List agents List agents for the account with pagination. @@ -144,7 +150,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentListResponse | HTTPValidationError + AgentListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -163,7 +169,7 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentListResponse | HTTPValidationError]: +) -> Response[AgentListResponse | HTTPValidationError | ServiceUnavailableError]: """List agents List agents for the account with pagination. @@ -183,7 +189,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentListResponse | HTTPValidationError] + Response[AgentListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -205,7 +211,7 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentListResponse | HTTPValidationError | None: +) -> AgentListResponse | HTTPValidationError | ServiceUnavailableError | None: """List agents List agents for the account with pagination. @@ -225,7 +231,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentListResponse | HTTPValidationError + AgentListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 8b82c95..d58fe6c 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.blocked_email_sender_list_response import BlockedEmailSenderListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -45,7 +46,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = BlockedEmailSenderListResponse.from_dict(response.json()) @@ -56,6 +62,11 @@ def _parse_response( 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: @@ -64,7 +75,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +93,9 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: """List blocked inbound email senders + the auto-block mode List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus @@ -100,7 +115,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderListResponse | HTTPValidationError] + Response[BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -124,7 +139,12 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | 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 @@ -144,7 +164,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderListResponse | HTTPValidationError + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -163,7 +183,9 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: """List blocked inbound email senders + the auto-block mode List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus @@ -183,7 +205,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderListResponse | HTTPValidationError] + Response[BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -205,7 +227,12 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | 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 @@ -225,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderListResponse | HTTPValidationError + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 877629a..7789044 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.inbound_email_rejection_response import InboundEmailRejectionResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -50,7 +51,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[InboundEmailRejectionResponse] + | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -68,6 +74,11 @@ def _parse_response( 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: @@ -76,7 +87,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +105,9 @@ def sync_detailed( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse] +]: """List discarded inbound emails List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, @@ -112,7 +127,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[InboundEmailRejectionResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse]] """ kwargs = _get_kwargs( @@ -136,7 +151,12 @@ def sync( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[InboundEmailRejectionResponse] + | None +): """List discarded inbound emails List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, @@ -156,7 +176,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[InboundEmailRejectionResponse] + HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse] """ return sync_detailed( @@ -175,7 +195,9 @@ async def asyncio_detailed( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse] +]: """List discarded inbound emails List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, @@ -195,7 +217,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[InboundEmailRejectionResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse]] """ kwargs = _get_kwargs( @@ -217,7 +239,12 @@ async def asyncio( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[InboundEmailRejectionResponse] + | None +): """List discarded inbound emails List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, @@ -237,7 +264,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[InboundEmailRejectionResponse] + HTTPValidationError | ServiceUnavailableError | list[InboundEmailRejectionResponse] """ return ( 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 index 5ae944b..01eff07 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.http_validation_error import HTTPValidationError from ...models.mark_ai_suggestion_request import MarkAiSuggestionRequest from ...models.ok_response import OkResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,7 +47,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = OkResponse.from_dict(response.json()) @@ -57,6 +58,11 @@ def _parse_response( 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: @@ -65,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +88,7 @@ def sync_detailed( body: MarkAiSuggestionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline suggestion Accept or decline a proposed AI assistant configuration for a conversation turn. @@ -106,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -132,7 +138,7 @@ def sync( body: MarkAiSuggestionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline suggestion Accept or decline a proposed AI assistant configuration for a conversation turn. @@ -156,7 +162,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return sync_detailed( @@ -177,7 +183,7 @@ async def asyncio_detailed( body: MarkAiSuggestionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline suggestion Accept or decline a proposed AI assistant configuration for a conversation turn. @@ -201,7 +207,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -225,7 +231,7 @@ async def asyncio( body: MarkAiSuggestionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline suggestion Accept or decline a proposed AI assistant configuration for a conversation turn. @@ -249,7 +255,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return ( 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 index 3e15d4e..fa98cc8 100644 --- 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 @@ -11,6 +11,7 @@ ) from ...models.agent_import_preview_request import AgentImportPreviewRequest from ...models.agent_import_preview_response import AgentImportPreviewResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -42,7 +43,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = AgentImportPreviewResponse.from_dict(response.json()) @@ -53,6 +59,11 @@ def _parse_response( 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: @@ -61,7 +72,11 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +91,11 @@ def sync_detailed( body: AgentImportPreviewRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError +]: """Preview an agent_definition import Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) @@ -85,6 +104,12 @@ def sync_detailed( failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. + Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text + lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, + and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, + cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may + still reject a payload this endpoint accepts. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. @@ -99,7 +124,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse] + Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -121,7 +146,12 @@ def sync( body: AgentImportPreviewRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError + | None +): """Preview an agent_definition import Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) @@ -130,6 +160,12 @@ def sync( failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. + Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text + lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, + and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, + cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may + still reject a payload this endpoint accepts. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. @@ -144,7 +180,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentImportPreviewResponse + AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | ServiceUnavailableError """ return sync_detailed( @@ -161,7 +197,11 @@ async def asyncio_detailed( body: AgentImportPreviewRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError +]: """Preview an agent_definition import Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) @@ -170,6 +210,12 @@ async def asyncio_detailed( failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. + Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text + lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, + and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, + cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may + still reject a payload this endpoint accepts. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. @@ -184,7 +230,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse] + Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +250,12 @@ async def asyncio( body: AgentImportPreviewRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentImportPreviewResponse + | ServiceUnavailableError + | None +): """Preview an agent_definition import Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) @@ -213,6 +264,12 @@ async def asyncio( failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. + Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text + lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, + and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, + cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may + still reject a payload this endpoint accepts. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. @@ -227,7 +284,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentImportPreviewResponse + AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | ServiceUnavailableError """ return ( 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 index 0cd5f06..0695d27 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Revoke an agent-email opt-out Revoke an opt-out (opt the recipient back in to agent emails). @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Revoke an agent-email opt-out Revoke an opt-out (opt the recipient back in to agent emails). @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Revoke an agent-email opt-out Revoke an opt-out (opt the recipient back in to agent emails). @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Revoke an agent-email opt-out Revoke an opt-out (opt the recipient back in to agent emails). @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d31e861..b968072 100644 --- 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 @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.resume_inbound_response import ResumeInboundResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ResumeInboundResponse | None: +) -> ResumeInboundResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ResumeInboundResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ResumeInboundResponse]: +) -> Response[ResumeInboundResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ResumeInboundResponse]: +) -> Response[ResumeInboundResponse | ServiceUnavailableError]: """Manually resume paused inbound email Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the @@ -79,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ResumeInboundResponse] + Response[ResumeInboundResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -99,7 +105,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ResumeInboundResponse | None: +) -> ResumeInboundResponse | ServiceUnavailableError | None: """Manually resume paused inbound email Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the @@ -117,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ResumeInboundResponse + ResumeInboundResponse | ServiceUnavailableError """ return sync_detailed( @@ -132,7 +138,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ResumeInboundResponse]: +) -> Response[ResumeInboundResponse | ServiceUnavailableError]: """Manually resume paused inbound email Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the @@ -150,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ResumeInboundResponse] + Response[ResumeInboundResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -168,7 +174,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ResumeInboundResponse | None: +) -> ResumeInboundResponse | ServiceUnavailableError | None: """Manually resume paused inbound email Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the @@ -186,7 +192,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ResumeInboundResponse + ResumeInboundResponse | ServiceUnavailableError """ return ( 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 720b5c0..f01bd90 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 @@ -11,6 +11,7 @@ from ...models.agent_run_response import AgentRunResponse from ...models.http_validation_error import HTTPValidationError from ...models.insufficient_credits_response import InsufficientCreditsResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -45,7 +46,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = AgentRunResponse.from_dict(response.json()) @@ -61,6 +68,11 @@ def _parse_response( 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: @@ -69,7 +81,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +102,12 @@ def sync_detailed( body: AgentRunRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError +]: """Run an agent Start an agent run. @@ -100,8 +122,10 @@ def sync_detailed( 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`). + - `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. - `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. @@ -126,7 +150,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse] + Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -150,7 +174,13 @@ def sync( body: AgentRunRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): """Run an agent Start an agent run. @@ -165,8 +195,10 @@ def sync( 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`). + - `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. - `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. @@ -191,7 +223,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse + AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError """ return sync_detailed( @@ -210,7 +242,12 @@ async def asyncio_detailed( body: AgentRunRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError +]: """Run an agent Start an agent run. @@ -225,8 +262,10 @@ async def asyncio_detailed( 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`). + - `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. - `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. @@ -251,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse] + Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -273,7 +312,13 @@ async def asyncio( body: AgentRunRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + AgentRunResponse + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): """Run an agent Start an agent run. @@ -288,8 +333,10 @@ async def asyncio( 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`). + - `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. - `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. @@ -314,7 +361,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse + AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError """ return ( 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 73f7476..c9582ba 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 @@ -10,6 +10,7 @@ from ...models.agent_run_stream_request import AgentRunStreamRequest from ...models.http_validation_error import HTTPValidationError from ...models.insufficient_credits_response import InsufficientCreditsResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + Any + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = response.json() return response_200 @@ -59,6 +66,11 @@ def _parse_response( 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: @@ -67,7 +79,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,7 +97,9 @@ def sync_detailed( body: AgentRunStreamRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError +]: """Run an agent (stream events) Start a **priority** agent run and stream run events using Server-Sent Events (SSE). @@ -100,13 +116,20 @@ def sync_detailed( 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`). + - `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. 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}`. + - `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 — 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`. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -123,7 +146,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | InsufficientCreditsResponse] + Response[Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -147,7 +170,13 @@ def sync( body: AgentRunStreamRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + Any + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): """Run an agent (stream events) Start a **priority** agent run and stream run events using Server-Sent Events (SSE). @@ -164,13 +193,20 @@ def sync( 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`). + - `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. 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}`. + - `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 — 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`. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -187,7 +223,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | InsufficientCreditsResponse + Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError """ return sync_detailed( @@ -206,7 +242,9 @@ async def asyncio_detailed( body: AgentRunStreamRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: +) -> Response[ + Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError +]: """Run an agent (stream events) Start a **priority** agent run and stream run events using Server-Sent Events (SSE). @@ -223,13 +261,20 @@ async def asyncio_detailed( 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`). + - `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. 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}`. + - `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 — 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`. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -246,7 +291,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | InsufficientCreditsResponse] + Response[Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -268,7 +313,13 @@ async def asyncio( body: AgentRunStreamRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: +) -> ( + Any + | HTTPValidationError + | InsufficientCreditsResponse + | ServiceUnavailableError + | None +): """Run an agent (stream events) Start a **priority** agent run and stream run events using Server-Sent Events (SSE). @@ -285,13 +336,20 @@ async def asyncio( 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`). + - `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. 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}`. + - `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 — 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`. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -308,7 +366,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | InsufficientCreditsResponse + Any | HTTPValidationError | InsufficientCreditsResponse | ServiceUnavailableError """ return ( 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 index 8b03e67..1ae3416 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.agent_trace_search_request import AgentTraceSearchRequest from ...models.agent_trace_search_response import AgentTraceSearchResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentTraceSearchResponse | HTTPValidationError | None: +) -> AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentTraceSearchResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentTraceSearchResponse | HTTPValidationError]: +) -> Response[AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: AgentTraceSearchRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentTraceSearchResponse | HTTPValidationError]: +) -> Response[AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError]: """Search agent traces Search agent traces using semantic similarity. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentTraceSearchResponse | HTTPValidationError] + Response[AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -120,7 +126,7 @@ def sync( body: AgentTraceSearchRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentTraceSearchResponse | HTTPValidationError | None: +) -> AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError | None: """Search agent traces Search agent traces using semantic similarity. @@ -144,7 +150,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentTraceSearchResponse | HTTPValidationError + AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -161,7 +167,7 @@ async def asyncio_detailed( body: AgentTraceSearchRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentTraceSearchResponse | HTTPValidationError]: +) -> Response[AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError]: """Search agent traces Search agent traces using semantic similarity. @@ -185,7 +191,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentTraceSearchResponse | HTTPValidationError] + Response[AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -205,7 +211,7 @@ async def asyncio( body: AgentTraceSearchRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentTraceSearchResponse | HTTPValidationError | None: +) -> AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError | None: """Search agent traces Search agent traces using semantic similarity. @@ -229,7 +235,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentTraceSearchResponse | HTTPValidationError + AgentTraceSearchResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index bd86896..05b6a8a 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.blocked_email_sender_list_response import BlockedEmailSenderListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.set_auto_block_mode_request import SetAutoBlockModeRequest from ...types import UNSET, Response, Unset @@ -40,7 +41,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = BlockedEmailSenderListResponse.from_dict(response.json()) @@ -51,6 +57,11 @@ def _parse_response( 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: @@ -59,7 +70,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +87,9 @@ def sync_detailed( body: SetAutoBlockModeRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: """Set the governance auto-block mode Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the @@ -94,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderListResponse | HTTPValidationError] + Response[BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +131,12 @@ def sync( body: SetAutoBlockModeRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Set the governance auto-block mode Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the @@ -136,7 +156,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderListResponse | HTTPValidationError + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +173,9 @@ async def asyncio_detailed( body: SetAutoBlockModeRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: +) -> Response[ + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError +]: """Set the governance auto-block mode Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the @@ -173,7 +195,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BlockedEmailSenderListResponse | HTTPValidationError] + Response[BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -193,7 +215,12 @@ async def asyncio( body: SetAutoBlockModeRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: +) -> ( + BlockedEmailSenderListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Set the governance auto-block mode Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the @@ -213,7 +240,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BlockedEmailSenderListResponse | HTTPValidationError + BlockedEmailSenderListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 159f2de..5ec9910 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.email_trigger_config_response import EmailTriggerConfigResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.set_email_trigger_config_request import SetEmailTriggerConfigRequest from ...types import UNSET, Response, Unset @@ -46,7 +47,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailTriggerConfigResponse | HTTPValidationError | None: +) -> EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EmailTriggerConfigResponse.from_dict(response.json()) @@ -57,6 +58,11 @@ def _parse_response( 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: @@ -65,7 +71,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailTriggerConfigResponse | HTTPValidationError]: +) -> Response[ + EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,9 @@ def sync_detailed( body: SetEmailTriggerConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailTriggerConfigResponse | HTTPValidationError]: +) -> Response[ + EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError +]: """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, @@ -108,7 +118,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailTriggerConfigResponse | HTTPValidationError] + Response[EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -134,7 +144,7 @@ def sync( body: SetEmailTriggerConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailTriggerConfigResponse | HTTPValidationError | None: +) -> EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, @@ -160,7 +170,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailTriggerConfigResponse | HTTPValidationError + EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -181,7 +191,9 @@ async def asyncio_detailed( body: SetEmailTriggerConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailTriggerConfigResponse | HTTPValidationError]: +) -> Response[ + EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError +]: """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, @@ -207,7 +219,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailTriggerConfigResponse | HTTPValidationError] + Response[EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -231,7 +243,7 @@ async def asyncio( body: SetEmailTriggerConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailTriggerConfigResponse | HTTPValidationError | None: +) -> EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, @@ -257,7 +269,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailTriggerConfigResponse | HTTPValidationError + EmailTriggerConfigResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index b75fd09..fbc9012 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Unblock an inbound email sender Remove a blocked sender by id. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Unblock an inbound email sender Remove a blocked sender by id. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Unblock an inbound email sender Remove a blocked sender by id. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Unblock an inbound email sender Remove a blocked sender by id. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index c290bf9..d3688e3 100644 --- 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 @@ -11,6 +11,7 @@ AgentDefinitionImportErrorResponse, ) from ...models.agent_summary_response import AgentSummaryResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_agent_request import UpdateAgentRequest from ...types import UNSET, Response, Unset @@ -46,7 +47,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = AgentSummaryResponse.from_dict(response.json()) @@ -57,6 +63,11 @@ def _parse_response( 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: @@ -65,7 +76,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,7 +94,9 @@ def sync_detailed( body: UpdateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError +]: """Update agent metadata Update an agent's name, description, evaluation settings, and model lifecycle settings. @@ -120,7 +135,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse] + Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -144,7 +159,12 @@ def sync( body: UpdateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | ServiceUnavailableError + | None +): """Update agent metadata Update an agent's name, description, evaluation settings, and model lifecycle settings. @@ -183,7 +203,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentSummaryResponse + AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError """ return sync_detailed( @@ -202,7 +222,9 @@ async def asyncio_detailed( body: UpdateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: +) -> Response[ + AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError +]: """Update agent metadata Update an agent's name, description, evaluation settings, and model lifecycle settings. @@ -241,7 +263,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse] + Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -263,7 +285,12 @@ async def asyncio( body: UpdateAgentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: +) -> ( + AgentDefinitionImportErrorResponse + | AgentSummaryResponse + | ServiceUnavailableError + | None +): """Update agent metadata Update an agent's name, description, evaluation settings, and model lifecycle settings. @@ -302,7 +329,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionImportErrorResponse | AgentSummaryResponse + AgentDefinitionImportErrorResponse | AgentSummaryResponse | ServiceUnavailableError """ return ( 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 index 9eb265f..460f9d6 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.agent_definition_response import AgentDefinitionResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_agent_definition_request import UpdateAgentDefinitionRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionResponse | HTTPValidationError | None: +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AgentDefinitionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionResponse | HTTPValidationError]: +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateAgentDefinitionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: """Update agent definition Update the agent's definition on the main branch. @@ -124,7 +130,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionResponse | HTTPValidationError] + Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -148,7 +154,7 @@ def sync( body: UpdateAgentDefinitionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: """Update agent definition Update the agent's definition on the main branch. @@ -193,7 +199,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionResponse | HTTPValidationError + AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -212,7 +218,7 @@ async def asyncio_detailed( body: UpdateAgentDefinitionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: +) -> Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError]: """Update agent definition Update the agent's definition on the main branch. @@ -257,7 +263,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentDefinitionResponse | HTTPValidationError] + Response[AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -279,7 +285,7 @@ async def asyncio( body: UpdateAgentDefinitionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: +) -> AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError | None: """Update agent definition Update the agent's definition on the main branch. @@ -324,7 +330,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentDefinitionResponse | HTTPValidationError + AgentDefinitionResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 752f224..6ec4404 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.ai_assistant_accept_request import AiAssistantAcceptRequest from ...models.ai_assistant_accept_response import AiAssistantAcceptResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantAcceptResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept and execute a standalone plan Accept and execute a previously proposed standalone plan. If the plan contains destructive actions @@ -98,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantAcceptResponse | HTTPValidationError] + Response[AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -122,7 +132,7 @@ def sync( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: """Accept and execute a standalone plan Accept and execute a previously proposed standalone plan. If the plan contains destructive actions @@ -141,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantAcceptResponse | HTTPValidationError + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -160,7 +170,9 @@ async def asyncio_detailed( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept and execute a standalone plan Accept and execute a previously proposed standalone plan. If the plan contains destructive actions @@ -179,7 +191,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantAcceptResponse | HTTPValidationError] + Response[AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -201,7 +213,7 @@ async def asyncio( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: """Accept and execute a standalone plan Accept and execute a previously proposed standalone plan. If the plan contains destructive actions @@ -220,7 +232,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantAcceptResponse | HTTPValidationError + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index f366512..aac5502 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline a standalone plan Decline a previously proposed standalone plan. No resources are modified. The conversation is marked @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline a standalone plan Decline a previously proposed standalone plan. No resources are modified. The conversation is marked @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline a standalone plan Decline a previously proposed standalone plan. No resources are modified. The conversation is marked @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline a standalone plan Decline a previously proposed standalone plan. No resources are modified. The conversation is marked @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 1dcb576..099170c 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.ai_assistant_feedback_request import AiAssistantFeedbackRequest from ...models.ai_assistant_feedback_response import AiAssistantFeedbackResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: +) -> AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantFeedbackResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantFeedbackResponse | HTTPValidationError]: +) -> Response[ + AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: AiAssistantFeedbackRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantFeedbackResponse | HTTPValidationError]: +) -> Response[ + AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError +]: """Submit AI assistant feedback Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantFeedbackResponse | HTTPValidationError] + Response[AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +124,7 @@ def sync( body: AiAssistantFeedbackRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: +) -> AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError | None: """Submit AI assistant feedback Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is @@ -132,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantFeedbackResponse | HTTPValidationError + AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +159,9 @@ async def asyncio_detailed( body: AiAssistantFeedbackRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantFeedbackResponse | HTTPValidationError]: +) -> Response[ + AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError +]: """Submit AI assistant feedback Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is @@ -167,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantFeedbackResponse | HTTPValidationError] + Response[AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +199,7 @@ async def asyncio( body: AiAssistantFeedbackRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: +) -> AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError | None: """Submit AI assistant feedback Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is @@ -205,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantFeedbackResponse | HTTPValidationError + AiAssistantFeedbackResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 3e391c6..eef51f1 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a knowledge base plan (standalone) Generate a knowledge base creation/modification plan without requiring an existing solution. May @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +124,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a knowledge base plan (standalone) Generate a knowledge base creation/modification plan without requiring an existing solution. May @@ -132,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +159,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a knowledge base plan (standalone) Generate a knowledge base creation/modification plan without requiring an existing solution. May @@ -167,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +199,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a knowledge base plan (standalone) Generate a knowledge base creation/modification plan without requiring an existing solution. May @@ -205,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index cc3674f..64c2ba4 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank_accept_request import MemoryBankAcceptRequest from ...models.ok_response import OkResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = OkResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -99,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +129,7 @@ def sync( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -143,7 +149,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +168,7 @@ async def asyncio_detailed( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -182,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +210,7 @@ async def asyncio( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -224,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return ( 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 index 1d9e8c1..6ed26fd 100644 --- 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 @@ -9,6 +9,7 @@ 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 ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = MemoryBankAiAssistantResponse.from_dict(response.json()) @@ -51,6 +54,11 @@ def _parse_response( 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: @@ -59,7 +67,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +84,9 @@ def sync_detailed( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: """Generate a memory bank configuration (standalone) Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -92,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankAiAssistantResponse] + Response[HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +126,9 @@ def sync( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError | None +): """Generate a memory bank configuration (standalone) Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -132,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankAiAssistantResponse + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +163,9 @@ async def asyncio_detailed( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: """Generate a memory bank configuration (standalone) Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -167,7 +183,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankAiAssistantResponse] + Response[HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +203,9 @@ async def asyncio( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError | None +): """Generate a memory bank configuration (standalone) Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -205,7 +223,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankAiAssistantResponse + HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError """ return ( 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 index eadc152..3df1051 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.memory_bank_last_conversation_response import ( MemoryBankLastConversationResponse, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -47,7 +48,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = MemoryBankLastConversationResponse.from_dict(response.json()) @@ -58,6 +64,11 @@ def _parse_response( 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: @@ -66,7 +77,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +95,9 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. @@ -102,7 +117,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankLastConversationResponse] + Response[HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -126,7 +141,12 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. @@ -146,7 +166,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankLastConversationResponse + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError """ return sync_detailed( @@ -165,7 +185,9 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. @@ -185,7 +207,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankLastConversationResponse] + Response[HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -207,7 +229,12 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. @@ -227,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankLastConversationResponse + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError """ return ( 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 index f82288e..f45736e 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a solution plan (standalone) Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +124,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a solution plan (standalone) Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an @@ -132,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +159,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a solution plan (standalone) Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an @@ -167,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +199,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a solution plan (standalone) Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an @@ -205,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index b26f986..6922856 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a source plan (standalone) Generate a content source creation/modification plan without requiring an existing solution. The AI @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +124,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a source plan (standalone) Generate a content source creation/modification plan without requiring an existing solution. The AI @@ -132,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +159,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a source plan (standalone) Generate a content source creation/modification plan without requiring an existing solution. The AI @@ -167,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +199,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate a source plan (standalone) Generate a content source creation/modification plan without requiring an existing solution. The AI @@ -205,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index a4ea912..2425942 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.add_comment_request import AddCommentRequest from ...models.alert_detail_response import AlertDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertDetailResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: AddCommentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Add alert comment Add a comment to an alert. Comments are visible to all subscribers and are included in the alert @@ -99,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +129,7 @@ def sync( body: AddCommentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Add alert comment Add a comment to an alert. Comments are visible to all subscribers and are included in the alert @@ -143,7 +149,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +168,7 @@ async def asyncio_detailed( body: AddCommentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Add alert comment Add a comment to an alert. Comments are visible to all subscribers and are included in the alert @@ -182,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +210,7 @@ async def asyncio( body: AddCommentRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Add alert comment Add a comment to an alert. Comments are visible to all subscribers and are included in the alert @@ -224,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d779479..807b0f7 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.alert_detail_response import AlertDetailResponse from ...models.change_status_request import ChangeStatusRequest from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertDetailResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: ChangeStatusRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Change alert status Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: ChangeStatusRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Change alert status Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: ChangeStatusRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Change alert status Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: ChangeStatusRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Change alert status Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index c441edf..0e6ba13 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.alert_config_response import AlertConfigResponse from ...models.create_alert_config_request import CreateAlertConfigRequest from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 201: response_201 = AlertConfigResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: CreateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Create alert config Create a new alert configuration. @@ -101,7 +107,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +129,7 @@ def sync( body: CreateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Create alert config Create a new alert configuration. @@ -150,7 +156,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -167,7 +173,7 @@ async def asyncio_detailed( body: CreateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Create alert config Create a new alert configuration. @@ -194,7 +200,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -214,7 +220,7 @@ async def asyncio( body: CreateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Create alert config Create a new alert configuration. @@ -241,7 +247,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 43820e9..5002875 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete alert config Delete an alert configuration. This permanently removes the config and stops any future alerts of @@ -89,7 +95,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -111,7 +117,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete alert config Delete an alert configuration. This permanently removes the config and stops any future alerts of @@ -130,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,7 +153,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete alert config Delete an alert configuration. This permanently removes the config and stops any future alerts of @@ -166,7 +172,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -186,7 +192,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete alert config Delete an alert configuration. This permanently removes the config and stops any future alerts of @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 98af202..2d1d896 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_config_response import AlertConfigResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertConfigResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Get alert config Get a specific alert configuration by ID. @@ -93,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -115,7 +121,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Get alert config Get a specific alert configuration by ID. @@ -136,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +159,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Get alert config Get a specific alert configuration by ID. @@ -174,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -194,7 +200,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Get alert config Get a specific alert configuration by ID. @@ -215,7 +221,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 0420d4e..4771f78 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_detail_response import AlertDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertDetailResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get alert detail Get full alert detail including history, comments, and subscribers. @@ -90,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -112,7 +118,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get alert detail Get full alert detail including history, comments, and subscribers. @@ -130,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,7 +153,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get alert detail Get full alert detail including history, comments, and subscribers. @@ -165,7 +171,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -185,7 +191,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get alert detail Get full alert detail including history, comments, and subscribers. @@ -203,7 +209,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index f09013c..69df1ae 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_config_list_response import AlertConfigListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -69,7 +70,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigListResponse | HTTPValidationError | None: +) -> AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertConfigListResponse.from_dict(response.json()) @@ -80,6 +81,11 @@ def _parse_response( 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: @@ -88,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigListResponse | HTTPValidationError]: +) -> Response[AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -107,7 +113,7 @@ def sync_detailed( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigListResponse | HTTPValidationError]: +) -> Response[AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError]: """List alert configs List alert configurations. @@ -139,7 +145,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigListResponse | HTTPValidationError] + Response[AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -169,7 +175,7 @@ def sync( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigListResponse | HTTPValidationError | None: +) -> AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError | None: """List alert configs List alert configurations. @@ -201,7 +207,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigListResponse | HTTPValidationError + AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -226,7 +232,7 @@ async def asyncio_detailed( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigListResponse | HTTPValidationError]: +) -> Response[AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError]: """List alert configs List alert configurations. @@ -258,7 +264,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigListResponse | HTTPValidationError] + Response[AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -286,7 +292,7 @@ async def asyncio( limit: int | Unset = 50, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigListResponse | HTTPValidationError | None: +) -> AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError | None: """List alert configs List alert configurations. @@ -318,7 +324,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigListResponse | HTTPValidationError + AlertConfigListResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py b/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py index 915e3c9..86a1202 100644 --- a/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py +++ b/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_list_response import AlertListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -90,7 +91,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertListResponse | HTTPValidationError | None: +) -> AlertListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertListResponse.from_dict(response.json()) @@ -101,6 +102,11 @@ def _parse_response( 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: @@ -109,7 +115,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertListResponse | HTTPValidationError]: +) -> Response[AlertListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -130,7 +136,7 @@ def sync_detailed( time_to: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertListResponse | HTTPValidationError]: +) -> Response[AlertListResponse | HTTPValidationError | ServiceUnavailableError]: """List alerts List alerts for the account with optional filters. @@ -160,7 +166,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertListResponse | HTTPValidationError] + Response[AlertListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -194,7 +200,7 @@ def sync( time_to: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertListResponse | HTTPValidationError | None: +) -> AlertListResponse | HTTPValidationError | ServiceUnavailableError | None: """List alerts List alerts for the account with optional filters. @@ -224,7 +230,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertListResponse | HTTPValidationError + AlertListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -253,7 +259,7 @@ async def asyncio_detailed( time_to: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertListResponse | HTTPValidationError]: +) -> Response[AlertListResponse | HTTPValidationError | ServiceUnavailableError]: """List alerts List alerts for the account with optional filters. @@ -283,7 +289,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertListResponse | HTTPValidationError] + Response[AlertListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -315,7 +321,7 @@ async def asyncio( time_to: datetime.datetime | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertListResponse | HTTPValidationError | None: +) -> AlertListResponse | HTTPValidationError | ServiceUnavailableError | None: """List alerts List alerts for the account with optional filters. @@ -345,7 +351,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertListResponse | HTTPValidationError + AlertListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 98cb70d..e08c2ca 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.organization_alert_preference_list_response import ( OrganizationAlertPreferenceListResponse, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -54,7 +55,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = OrganizationAlertPreferenceListResponse.from_dict( response.json() @@ -67,6 +73,11 @@ def _parse_response( 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: @@ -75,7 +86,11 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: +) -> Response[ + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -91,7 +106,11 @@ def sync_detailed( include_defaults: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: +) -> Response[ + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError +]: """List organization alert delivery preferences List per-organization alert delivery preferences for the authenticated user. @@ -115,7 +134,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OrganizationAlertPreferenceListResponse] + Response[HTTPValidationError | OrganizationAlertPreferenceListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -139,7 +158,12 @@ def sync( include_defaults: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError + | None +): """List organization alert delivery preferences List per-organization alert delivery preferences for the authenticated user. @@ -163,7 +187,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OrganizationAlertPreferenceListResponse + HTTPValidationError | OrganizationAlertPreferenceListResponse | ServiceUnavailableError """ return sync_detailed( @@ -182,7 +206,11 @@ async def asyncio_detailed( include_defaults: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: +) -> Response[ + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError +]: """List organization alert delivery preferences List per-organization alert delivery preferences for the authenticated user. @@ -206,7 +234,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OrganizationAlertPreferenceListResponse] + Response[HTTPValidationError | OrganizationAlertPreferenceListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -228,7 +256,12 @@ async def asyncio( include_defaults: bool | Unset = False, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceListResponse + | ServiceUnavailableError + | None +): """List organization alert delivery preferences List per-organization alert delivery preferences for the authenticated user. @@ -252,7 +285,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OrganizationAlertPreferenceListResponse + HTTPValidationError | OrganizationAlertPreferenceListResponse | ServiceUnavailableError """ return ( 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 index cc78bcf..56c699b 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_detail_response import AlertDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertDetailResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,11 +78,12 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """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. + status changes or new comments are added, for as long as they remain an owner or administrator of + the account. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -91,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,11 +120,12 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | 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. + status changes or new comments are added, for as long as they remain an owner or administrator of + the account. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -132,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,11 +157,12 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """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. + status changes or new comments are added, for as long as they remain an owner or administrator of + the account. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -168,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,11 +197,12 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | 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. + status changes or new comments are added, for as long as they remain an owner or administrator of + the account. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -207,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index b0e9646..d8ba34a 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_detail_response import AlertDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertDetailResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Unsubscribe from alert Unsubscribe the current user from an alert. The user will no longer receive email notifications for @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Unsubscribe from alert Unsubscribe the current user from an alert. The user will no longer receive email notifications for @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: +) -> Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Unsubscribe from alert Unsubscribe the current user from an alert. The user will no longer receive email notifications for @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertDetailResponse | HTTPValidationError] + Response[AlertDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: +) -> AlertDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Unsubscribe from alert Unsubscribe the current user from an alert. The user will no longer receive email notifications for @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertDetailResponse | HTTPValidationError + AlertDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 77e9c45..ae218f8 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.alert_config_response import AlertConfigResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_alert_config_request import UpdateAlertConfigRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AlertConfigResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Update alert config Update an alert configuration. Only provided fields are updated. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: UpdateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Update alert config Update an alert configuration. Only provided fields are updated. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: UpdateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: +) -> Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError]: """Update alert config Update an alert configuration. Only provided fields are updated. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertConfigResponse | HTTPValidationError] + Response[AlertConfigResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: UpdateAlertConfigRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: +) -> AlertConfigResponse | HTTPValidationError | ServiceUnavailableError | None: """Update alert config Update an alert configuration. Only provided fields are updated. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertConfigResponse | HTTPValidationError + AlertConfigResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 05906ef..20c448d 100644 --- 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 @@ -11,6 +11,7 @@ from ...models.organization_alert_preference_response import ( OrganizationAlertPreferenceResponse, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_organization_alert_preference_request import ( UpdateOrganizationAlertPreferenceRequest, ) @@ -50,7 +51,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = OrganizationAlertPreferenceResponse.from_dict(response.json()) @@ -61,6 +67,11 @@ def _parse_response( 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: @@ -69,7 +80,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: +) -> Response[ + HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +99,9 @@ def sync_detailed( body: UpdateOrganizationAlertPreferenceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: +) -> Response[ + HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError +]: """Update organization alert delivery preference Update the authenticated user's personal delivery preference for one alert type in one organization. @@ -110,7 +125,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OrganizationAlertPreferenceResponse] + Response[HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -136,7 +151,12 @@ def sync( body: UpdateOrganizationAlertPreferenceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceResponse + | ServiceUnavailableError + | None +): """Update organization alert delivery preference Update the authenticated user's personal delivery preference for one alert type in one organization. @@ -160,7 +180,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OrganizationAlertPreferenceResponse + HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError """ return sync_detailed( @@ -181,7 +201,9 @@ async def asyncio_detailed( body: UpdateOrganizationAlertPreferenceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: +) -> Response[ + HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError +]: """Update organization alert delivery preference Update the authenticated user's personal delivery preference for one alert type in one organization. @@ -205,7 +227,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OrganizationAlertPreferenceResponse] + Response[HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -229,7 +251,12 @@ async def asyncio( body: UpdateOrganizationAlertPreferenceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: +) -> ( + HTTPValidationError + | OrganizationAlertPreferenceResponse + | ServiceUnavailableError + | None +): """Update organization alert delivery preference Update the authenticated user's personal delivery preference for one alert type in one organization. @@ -253,7 +280,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OrganizationAlertPreferenceResponse + HTTPValidationError | OrganizationAlertPreferenceResponse | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/cloud_drives/__init__.py b/seclai/_generated/api/cloud_drives/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/cloud_drives/delete_cloud_drive_api_api_cloud_drives_connection_id_delete.py b/seclai/_generated/api/cloud_drives/delete_cloud_drive_api_api_cloud_drives_connection_id_delete.py new file mode 100644 index 0000000..ae17d8b --- /dev/null +++ b/seclai/_generated/api/cloud_drives/delete_cloud_drive_api_api_cloud_drives_connection_id_delete.py @@ -0,0 +1,230 @@ +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.ok_response import OkResponse +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + 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": "/cloud-drives/{connection_id}".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | 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 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[HTTPValidationError | OkResponse | 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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: + """Delete a cloud-drive connection + + Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on + it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET + /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so + treat the 409 as the authoritative check rather than a clean /agents response. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | OkResponse | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: + """Delete a cloud-drive connection + + Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on + it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET + /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so + treat the 409 as the authoritative check rather than a clean /agents response. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | OkResponse | ServiceUnavailableError + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: + """Delete a cloud-drive connection + + Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on + it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET + /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so + treat the 409 as the authoritative check rather than a clean /agents response. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | OkResponse | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: + """Delete a cloud-drive connection + + Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on + it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET + /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so + treat the 409 as the authoritative check rather than a clean /agents response. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | OkResponse | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/disconnect_cloud_drive_api_api_cloud_drives_connection_id_disconnect_post.py b/seclai/_generated/api/cloud_drives/disconnect_cloud_drive_api_api_cloud_drives_connection_id_disconnect_post.py new file mode 100644 index 0000000..47c3803 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/disconnect_cloud_drive_api_api_cloud_drives_connection_id_disconnect_post.py @@ -0,0 +1,222 @@ +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.cloud_drive_response_model import CloudDriveResponseModel +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + 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": "/cloud-drives/{connection_id}/disconnect".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = CloudDriveResponseModel.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[CloudDriveResponseModel | 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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Disconnect a cloud-drive connection + + Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it + can be reconnected from the app. Agents bound to it stop firing until it is reconnected. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Disconnect a cloud-drive connection + + Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it + can be reconnected from the app. Agents bound to it stop firing until it is reconnected. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Disconnect a cloud-drive connection + + Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it + can be reconnected from the app. Agents bound to it stop firing until it is reconnected. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Disconnect a cloud-drive connection + + Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it + can be reconnected from the app. Agents bound to it stop firing until it is reconnected. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/get_agents_using_cloud_drive_api_api_cloud_drives_connection_id_agents_get.py b/seclai/_generated/api/cloud_drives/get_agents_using_cloud_drive_api_api_cloud_drives_connection_id_agents_get.py new file mode 100644 index 0000000..cb62e18 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/get_agents_using_cloud_drive_api_api_cloud_drives_connection_id_agents_get.py @@ -0,0 +1,258 @@ +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_using_cloud_drive_response_model import ( + AgentUsingCloudDriveResponseModel, +) +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + 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": "/cloud-drives/{connection_id}/agents".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] + | None +): + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AgentUsingCloudDriveResponseModel.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 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[ + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] +]: + """List agents using a cloud-drive connection + + Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or + a file-change trigger. Check this before disconnecting or deleting a connection. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | ServiceUnavailableError | list[AgentUsingCloudDriveResponseModel]] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] + | None +): + """List agents using a cloud-drive connection + + Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or + a file-change trigger. Check this before disconnecting or deleting a connection. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | ServiceUnavailableError | list[AgentUsingCloudDriveResponseModel] + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] +]: + """List agents using a cloud-drive connection + + Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or + a file-change trigger. Check this before disconnecting or deleting a connection. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | ServiceUnavailableError | list[AgentUsingCloudDriveResponseModel]] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[AgentUsingCloudDriveResponseModel] + | None +): + """List agents using a cloud-drive connection + + Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or + a file-change trigger. Check this before disconnecting or deleting a connection. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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 | ServiceUnavailableError | list[AgentUsingCloudDriveResponseModel] + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/get_cloud_drive_api_api_cloud_drives_connection_id_get.py b/seclai/_generated/api/cloud_drives/get_cloud_drive_api_api_cloud_drives_connection_id_get.py new file mode 100644 index 0000000..653c337 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/get_cloud_drive_api_api_cloud_drives_connection_id_get.py @@ -0,0 +1,218 @@ +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.cloud_drive_response_model import CloudDriveResponseModel +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + 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": "/cloud-drives/{connection_id}".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = CloudDriveResponseModel.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[CloudDriveResponseModel | 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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Get a cloud-drive connection + + Fetch a single cloud-drive connection by id. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Get a cloud-drive connection + + Fetch a single cloud-drive connection by id. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Get a cloud-drive connection + + Fetch a single cloud-drive connection by id. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Get a cloud-drive connection + + Fetch a single cloud-drive connection by id. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + 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: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/list_cloud_drive_providers_api_api_cloud_drives_providers_get.py b/seclai/_generated/api/cloud_drives/list_cloud_drive_providers_api_api_cloud_drives_providers_get.py new file mode 100644 index 0000000..40d7cc4 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/list_cloud_drive_providers_api_api_cloud_drives_providers_get.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cloud_drive_provider_response_model import ( + CloudDriveProviderResponseModel, +) +from ...models.service_unavailable_error import ServiceUnavailableError +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": "/cloud-drives/providers", + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceUnavailableError | list[CloudDriveProviderResponseModel] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CloudDriveProviderResponseModel.from_dict( + response_200_item_data + ) + + response_200.append(response_200_item) + + return response_200 + + 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[ServiceUnavailableError | list[CloudDriveProviderResponseModel]]: + 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[ServiceUnavailableError | list[CloudDriveProviderResponseModel]]: + """List configured cloud-drive providers + + List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, + Google Drive), with the permissions each requests. A provider missing from this list cannot be + connected here. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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[ServiceUnavailableError | list[CloudDriveProviderResponseModel]] + """ + + 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, +) -> ServiceUnavailableError | list[CloudDriveProviderResponseModel] | None: + """List configured cloud-drive providers + + List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, + Google Drive), with the permissions each requests. A provider missing from this list cannot be + connected here. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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: + ServiceUnavailableError | list[CloudDriveProviderResponseModel] + """ + + 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[ServiceUnavailableError | list[CloudDriveProviderResponseModel]]: + """List configured cloud-drive providers + + List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, + Google Drive), with the permissions each requests. A provider missing from this list cannot be + connected here. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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[ServiceUnavailableError | list[CloudDriveProviderResponseModel]] + """ + + 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, +) -> ServiceUnavailableError | list[CloudDriveProviderResponseModel] | None: + """List configured cloud-drive providers + + List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, + Google Drive), with the permissions each requests. A provider missing from this list cannot be + connected here. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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: + ServiceUnavailableError | list[CloudDriveProviderResponseModel] + """ + + return ( + await asyncio_detailed( + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/list_cloud_drive_rejections_api_api_cloud_drives_connection_id_rejections_get.py b/seclai/_generated/api/cloud_drives/list_cloud_drive_rejections_api_api_cloud_drives_connection_id_rejections_get.py new file mode 100644 index 0000000..3394556 --- /dev/null +++ b/seclai/_generated/api/cloud_drives/list_cloud_drive_rejections_api_api_cloud_drives_connection_id_rejections_get.py @@ -0,0 +1,294 @@ +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.cloud_drive_rejection_response_model import ( + CloudDriveRejectionResponseModel, +) +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + connection_id: UUID, + *, + 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] = {} + + 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": "/cloud-drives/{connection_id}/rejections".format( + connection_id=quote(str(connection_id), safe=""), + ), + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] + | None +): + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CloudDriveRejectionResponseModel.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 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[ + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] +]: + r"""List files this connection did not process + + Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above + the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync + or per-account run cap was hit, so remaining changes were dropped). + + This is the answer to \"why didn't my agent run for that file?\" — a skipped file fires no trigger + and appears nowhere else. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + 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 | ServiceUnavailableError | list[CloudDriveRejectionResponseModel]] + """ + + kwargs = _get_kwargs( + connection_id=connection_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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] + | None +): + r"""List files this connection did not process + + Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above + the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync + or per-account run cap was hit, so remaining changes were dropped). + + This is the answer to \"why didn't my agent run for that file?\" — a skipped file fires no trigger + and appears nowhere else. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + 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 | ServiceUnavailableError | list[CloudDriveRejectionResponseModel] + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] +]: + r"""List files this connection did not process + + Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above + the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync + or per-account run cap was hit, so remaining changes were dropped). + + This is the answer to \"why didn't my agent run for that file?\" — a skipped file fires no trigger + and appears nowhere else. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + 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 | ServiceUnavailableError | list[CloudDriveRejectionResponseModel]] + """ + + kwargs = _get_kwargs( + connection_id=connection_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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[CloudDriveRejectionResponseModel] + | None +): + r"""List files this connection did not process + + Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above + the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync + or per-account run cap was hit, so remaining changes were dropped). + + This is the answer to \"why didn't my agent run for that file?\" — a skipped file fires no trigger + and appears nowhere else. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + 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 | ServiceUnavailableError | list[CloudDriveRejectionResponseModel] + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/list_cloud_drives_api_api_cloud_drives_get.py b/seclai/_generated/api/cloud_drives/list_cloud_drives_api_api_cloud_drives_get.py new file mode 100644 index 0000000..7ec149f --- /dev/null +++ b/seclai/_generated/api/cloud_drives/list_cloud_drives_api_api_cloud_drives_get.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cloud_drive_response_model import CloudDriveResponseModel +from ...models.service_unavailable_error import ServiceUnavailableError +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": "/cloud-drives", + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceUnavailableError | list[CloudDriveResponseModel] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CloudDriveResponseModel.from_dict( + response_200_item_data + ) + + response_200.append(response_200_item) + + return response_200 + + 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[ServiceUnavailableError | list[CloudDriveResponseModel]]: + 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[ServiceUnavailableError | list[CloudDriveResponseModel]]: + """List the account's cloud-drive connections + + List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` + when creating a `cloud_drive` content source or binding a file-change agent trigger. + `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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[ServiceUnavailableError | list[CloudDriveResponseModel]] + """ + + 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, +) -> ServiceUnavailableError | list[CloudDriveResponseModel] | None: + """List the account's cloud-drive connections + + List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` + when creating a `cloud_drive` content source or binding a file-change agent trigger. + `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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: + ServiceUnavailableError | list[CloudDriveResponseModel] + """ + + 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[ServiceUnavailableError | list[CloudDriveResponseModel]]: + """List the account's cloud-drive connections + + List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` + when creating a `cloud_drive` content source or binding a file-change agent trigger. + `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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[ServiceUnavailableError | list[CloudDriveResponseModel]] + """ + + 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, +) -> ServiceUnavailableError | list[CloudDriveResponseModel] | None: + """List the account's cloud-drive connections + + List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` + when creating a `cloud_drive` content source or binding a file-change agent trigger. + `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + 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: + ServiceUnavailableError | list[CloudDriveResponseModel] + """ + + return ( + await asyncio_detailed( + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/cloud_drives/update_cloud_drive_api_api_cloud_drives_connection_id_patch.py b/seclai/_generated/api/cloud_drives/update_cloud_drive_api_api_cloud_drives_connection_id_patch.py new file mode 100644 index 0000000..990997a --- /dev/null +++ b/seclai/_generated/api/cloud_drives/update_cloud_drive_api_api_cloud_drives_connection_id_patch.py @@ -0,0 +1,240 @@ +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.cloud_drive_response_model import CloudDriveResponseModel +from ...models.cloud_drive_update_request import CloudDriveUpdateRequest +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + connection_id: UUID, + *, + body: CloudDriveUpdateRequest, + 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": "/cloud-drives/{connection_id}".format( + connection_id=quote(str(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 +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = CloudDriveResponseModel.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[CloudDriveResponseModel | 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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + body: CloudDriveUpdateRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Update a cloud-drive connection + + Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, + so existing files in the new folder are not replayed as triggers. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (CloudDriveUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + body: CloudDriveUpdateRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Update a cloud-drive connection + + Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, + so existing files in the new folder are not replayed as triggers. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (CloudDriveUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + body: CloudDriveUpdateRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError]: + """Update a cloud-drive connection + + Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, + so existing files in the new folder are not replayed as triggers. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (CloudDriveUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + connection_id=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( + connection_id: UUID, + *, + client: AuthenticatedClient | Client, + body: CloudDriveUpdateRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError | None: + """Update a cloud-drive connection + + Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, + so existing files in the new folder are not replayed as triggers. + + Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. + + Args: + connection_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (CloudDriveUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CloudDriveResponseModel | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed 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 index d9d83fc..d1667a6 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -39,16 +40,25 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 + 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: @@ -57,7 +67,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +82,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete content Delete a content item (a `SourceConnectionContentVersion`). @@ -83,6 +93,8 @@ def sync_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. + - 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. Args: source_connection_content_version (str): @@ -94,7 +106,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +128,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete content Delete a content item (a `SourceConnectionContentVersion`). @@ -127,6 +139,8 @@ def sync( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. + - 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. Args: source_connection_content_version (str): @@ -138,7 +152,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +169,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete content Delete a content item (a `SourceConnectionContentVersion`). @@ -166,6 +180,8 @@ async def asyncio_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. + - 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. Args: source_connection_content_version (str): @@ -177,7 +193,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -197,7 +213,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete content Delete a content item (a `SourceConnectionContentVersion`). @@ -208,6 +224,8 @@ async def asyncio( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. + - 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. Args: source_connection_content_version (str): @@ -219,7 +237,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 77a085a..76ff684 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.content_detail_response import ContentDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -51,7 +52,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentDetailResponse | HTTPValidationError | None: +) -> ContentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ContentDetailResponse.from_dict(response.json()) @@ -62,6 +63,11 @@ def _parse_response( 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: @@ -70,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentDetailResponse | HTTPValidationError]: +) -> Response[ContentDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,7 +93,7 @@ def sync_detailed( end: int | Unset = 5000, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ContentDetailResponse | HTTPValidationError]: +) -> Response[ContentDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get content details Get detailed information about a specific content item (a `SourceConnectionContentVersion`). @@ -116,7 +122,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ContentDetailResponse | HTTPValidationError] + Response[ContentDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -142,7 +148,7 @@ def sync( end: int | Unset = 5000, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ContentDetailResponse | HTTPValidationError | None: +) -> ContentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get content details Get detailed information about a specific content item (a `SourceConnectionContentVersion`). @@ -171,7 +177,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ContentDetailResponse | HTTPValidationError + ContentDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -192,7 +198,7 @@ async def asyncio_detailed( end: int | Unset = 5000, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ContentDetailResponse | HTTPValidationError]: +) -> Response[ContentDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get content details Get detailed information about a specific content item (a `SourceConnectionContentVersion`). @@ -221,7 +227,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ContentDetailResponse | HTTPValidationError] + Response[ContentDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -245,7 +251,7 @@ async def asyncio( end: int | Unset = 5000, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ContentDetailResponse | HTTPValidationError | None: +) -> ContentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get content details Get detailed information about a specific content item (a `SourceConnectionContentVersion`). @@ -274,7 +280,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ContentDetailResponse | HTTPValidationError + ContentDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 51993a1..fd50c36 100644 --- 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 @@ -9,6 +9,7 @@ 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 @@ -51,7 +52,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: +) -> ( + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = ContentEmbeddingsListResponse.from_dict(response.json()) @@ -62,6 +65,11 @@ def _parse_response( 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: @@ -70,7 +78,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: +) -> Response[ + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,7 +97,9 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: +) -> Response[ + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: """List content embeddings List the embeddings (chunk vectors) for a content item, with pagination. @@ -111,7 +123,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ContentEmbeddingsListResponse | HTTPValidationError] + Response[ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -137,7 +149,9 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: +) -> ( + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List content embeddings List the embeddings (chunk vectors) for a content item, with pagination. @@ -161,7 +175,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ContentEmbeddingsListResponse | HTTPValidationError + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -182,7 +196,9 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: +) -> Response[ + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: """List content embeddings List the embeddings (chunk vectors) for a content item, with pagination. @@ -206,7 +222,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ContentEmbeddingsListResponse | HTTPValidationError] + Response[ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -230,7 +246,9 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: +) -> ( + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError | None +): """List content embeddings List the embeddings (chunk vectors) for a content item, with pagination. @@ -254,7 +272,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ContentEmbeddingsListResponse | HTTPValidationError + ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 6ae15de..7bbcfb4 100644 --- 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -10,6 +10,7 @@ from ...models.file_upload_response import FileUploadResponse from ...models.http_validation_error import HTTPValidationError from ...models.inline_text_replace_request import InlineTextReplaceRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,17 +47,26 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = FileUploadResponse.from_dict(response.json()) 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 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: @@ -65,7 +75,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,7 +91,7 @@ def sync_detailed( body: InlineTextReplaceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: """Replace a content version with inline text Replace a content version using a small inline text payload. @@ -99,8 +109,13 @@ def sync_detailed( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + - 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. Args: source_connection_content_version (str): @@ -113,7 +128,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[FileUploadResponse | HTTPValidationError] + Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -137,7 +152,7 @@ def sync( body: InlineTextReplaceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: """Replace a content version with inline text Replace a content version using a small inline text payload. @@ -155,8 +170,13 @@ def sync( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + - 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. Args: source_connection_content_version (str): @@ -169,7 +189,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - FileUploadResponse | HTTPValidationError + Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -188,7 +208,7 @@ async def asyncio_detailed( body: InlineTextReplaceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: """Replace a content version with inline text Replace a content version using a small inline text payload. @@ -206,8 +226,13 @@ async def asyncio_detailed( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + - 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. Args: source_connection_content_version (str): @@ -220,7 +245,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[FileUploadResponse | HTTPValidationError] + Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -242,7 +267,7 @@ async def asyncio( body: InlineTextReplaceRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: """Replace a content version with inline text Replace a content version using a small inline text payload. @@ -260,8 +285,13 @@ async def asyncio( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + - 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. Args: source_connection_content_version (str): @@ -274,7 +304,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - FileUploadResponse | HTTPValidationError + Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 b88a98c..cd8a7ef 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -12,6 +12,7 @@ ) from ...models.file_upload_response import FileUploadResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,17 +47,26 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = FileUploadResponse.from_dict(response.json()) 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 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: @@ -65,7 +75,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,7 +91,7 @@ def sync_detailed( body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: r"""Replace a content version with a new upload Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. @@ -89,7 +99,8 @@ def sync_detailed( 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. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -126,6 +137,11 @@ def sync_detailed( - `video/x-msvideo` Notes: + - 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. + - 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. - 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 @@ -150,7 +166,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[FileUploadResponse | HTTPValidationError] + Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -174,7 +190,7 @@ def sync( body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: r"""Replace a content version with a new upload Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. @@ -182,7 +198,8 @@ def sync( 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. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -219,6 +236,11 @@ def sync( - `video/x-msvideo` Notes: + - 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. + - 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. - 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 @@ -243,7 +265,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - FileUploadResponse | HTTPValidationError + Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -262,7 +284,7 @@ async def asyncio_detailed( body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: +) -> Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError]: r"""Replace a content version with a new upload Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. @@ -270,7 +292,8 @@ async def asyncio_detailed( 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. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -307,6 +330,11 @@ async def asyncio_detailed( - `video/x-msvideo` Notes: + - 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. + - 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. - 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 @@ -331,7 +359,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[FileUploadResponse | HTTPValidationError] + Response[Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -353,7 +381,7 @@ async def asyncio( body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: +) -> Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError | None: r"""Replace a content version with a new upload Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. @@ -361,7 +389,8 @@ async def asyncio( 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. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -398,6 +427,11 @@ async def asyncio( - `video/x-msvideo` Notes: + - 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. + - 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. - 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 @@ -422,7 +456,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - FileUploadResponse | HTTPValidationError + Any | FileUploadResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 8abdb0a..55e412d 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.add_email_domain_request import AddEmailDomainRequest from ...models.email_domain_response import EmailDomainResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EmailDomainResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: AddEmailDomainRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: """Add + provision an email domain Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, @@ -95,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -117,7 +123,7 @@ def sync( body: AddEmailDomainRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: """Add + provision an email domain Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, @@ -138,7 +144,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +161,7 @@ async def asyncio_detailed( body: AddEmailDomainRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: """Add + provision an email domain Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, @@ -176,7 +182,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -196,7 +202,7 @@ async def asyncio( body: AddEmailDomainRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: """Add + provision an email domain Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, @@ -217,7 +223,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d9a5537..10f6485 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.dmarc_summary_response import DmarcSummaryResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -49,7 +50,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DmarcSummaryResponse | HTTPValidationError | None: +) -> DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = DmarcSummaryResponse.from_dict(response.json()) @@ -60,6 +61,11 @@ def _parse_response( 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: @@ -68,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DmarcSummaryResponse | HTTPValidationError]: +) -> Response[DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +91,7 @@ def sync_detailed( top_sources: int | Unset = 10, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[DmarcSummaryResponse | HTTPValidationError]: +) -> Response[DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """DMARC aggregate-report summary for a domain Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the @@ -108,7 +114,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DmarcSummaryResponse | HTTPValidationError] + Response[DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -134,7 +140,7 @@ def sync( top_sources: int | Unset = 10, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> DmarcSummaryResponse | HTTPValidationError | None: +) -> DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """DMARC aggregate-report summary for a domain Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the @@ -157,7 +163,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DmarcSummaryResponse | HTTPValidationError + DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -178,7 +184,7 @@ async def asyncio_detailed( top_sources: int | Unset = 10, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[DmarcSummaryResponse | HTTPValidationError]: +) -> Response[DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError]: """DMARC aggregate-report summary for a domain Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the @@ -201,7 +207,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DmarcSummaryResponse | HTTPValidationError] + Response[DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -225,7 +231,7 @@ async def asyncio( top_sources: int | Unset = 10, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> DmarcSummaryResponse | HTTPValidationError | None: +) -> DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError | None: """DMARC aggregate-report summary for a domain Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the @@ -248,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DmarcSummaryResponse | HTTPValidationError + DmarcSummaryResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 27ebc69..c596a43 100644 --- 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 @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.email_domains_list_response import EmailDomainsListResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainsListResponse | None: +) -> EmailDomainsListResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EmailDomainsListResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainsListResponse]: +) -> Response[EmailDomainsListResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainsListResponse]: +) -> Response[EmailDomainsListResponse | ServiceUnavailableError]: """List the account's email domains + plan capabilities List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email @@ -81,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainsListResponse] + Response[EmailDomainsListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -101,7 +107,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainsListResponse | None: +) -> EmailDomainsListResponse | ServiceUnavailableError | None: """List the account's email domains + plan capabilities List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email @@ -121,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainsListResponse + EmailDomainsListResponse | ServiceUnavailableError """ return sync_detailed( @@ -136,7 +142,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainsListResponse]: +) -> Response[EmailDomainsListResponse | ServiceUnavailableError]: """List the account's email domains + plan capabilities List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email @@ -156,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainsListResponse] + Response[EmailDomainsListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -174,7 +180,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainsListResponse | None: +) -> EmailDomainsListResponse | ServiceUnavailableError | None: """List the account's email domains + plan capabilities List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email @@ -194,7 +200,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainsListResponse + EmailDomainsListResponse | ServiceUnavailableError """ return ( 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 index 3e3254b..5c29eec 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.remove_email_domain_response import RemoveEmailDomainResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | RemoveEmailDomainResponse | None: +) -> HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = RemoveEmailDomainResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: +) -> Response[ + HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +80,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: +) -> Response[ + HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError +]: """Remove an email domain Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a @@ -93,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RemoveEmailDomainResponse] + Response[HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -115,7 +125,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | RemoveEmailDomainResponse | None: +) -> HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError | None: """Remove an email domain Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a @@ -136,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RemoveEmailDomainResponse + HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +163,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: +) -> Response[ + HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError +]: """Remove an email domain Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a @@ -174,7 +186,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RemoveEmailDomainResponse] + Response[HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -194,7 +206,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | RemoveEmailDomainResponse | None: +) -> HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError | None: """Remove an email domain Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a @@ -215,7 +227,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RemoveEmailDomainResponse + HTTPValidationError | RemoveEmailDomainResponse | ServiceUnavailableError """ return ( 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 index 9717401..8c0f350 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.send_test_email_response import SendTestEmailResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SendTestEmailResponse | None: +) -> HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = SendTestEmailResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SendTestEmailResponse]: +) -> Response[HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SendTestEmailResponse]: +) -> Response[HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError]: """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 @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SendTestEmailResponse] + Response[HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +120,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SendTestEmailResponse | None: +) -> HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError | 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 @@ -134,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SendTestEmailResponse + HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError """ return sync_detailed( @@ -151,7 +157,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SendTestEmailResponse]: +) -> Response[HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError]: """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 @@ -171,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SendTestEmailResponse] + Response[HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SendTestEmailResponse | None: +) -> HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError | 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 @@ -211,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SendTestEmailResponse + HTTPValidationError | SendTestEmailResponse | ServiceUnavailableError """ return ( 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 index 46b83f8..51deb6e 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.email_domain_response import EmailDomainResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EmailDomainResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,12 +78,13 @@ def sync_detailed( 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 +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: + """Make a verified domain the account's primary sending 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. + Promote a verified domain to the account's primary domain — agent email then sends FROM this domain + and shows its addresses on it (`@`, `@`) instead of the shared + `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared + form. 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. @@ -92,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,12 +121,13 @@ def sync( 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 +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: + """Make a verified domain the account's primary sending 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. + Promote a verified domain to the account's primary domain — agent email then sends FROM this domain + and shows its addresses on it (`@`, `@`) instead of the shared + `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared + form. 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. @@ -134,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -151,12 +159,13 @@ async def asyncio_detailed( 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 +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: + """Make a verified domain the account's primary sending 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. + Promote a verified domain to the account's primary domain — agent email then sends FROM this domain + and shows its addresses on it (`@`, `@`) instead of the shared + `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared + form. 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. @@ -171,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,12 +200,13 @@ async def asyncio( 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 +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: + """Make a verified domain the account's primary sending 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. + Promote a verified domain to the account's primary domain — agent email then sends FROM this domain + and shows its addresses on it (`@`, `@`) instead of the shared + `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared + form. 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. @@ -211,7 +221,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 8de81c5..9a64d80 100644 --- 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 @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -32,9 +33,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: +) -> Any | ServiceUnavailableError | None: if response.status_code == 204: - return None + response_204 = cast(Any, None) + return response_204 + + 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) @@ -44,7 +51,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,12 +65,12 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: """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. + Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending + domain, 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. @@ -77,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -92,17 +99,51 @@ def sync_detailed( return _build_response(client=client, response=response) +def sync( + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Any | ServiceUnavailableError | None: + """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 + domain, 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: + Any | ServiceUnavailableError + """ + + 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[Any]: +) -> Response[Any | ServiceUnavailableError]: """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. + Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending + domain, 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. @@ -116,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -127,3 +168,39 @@ async def asyncio_detailed( 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, +) -> Any | ServiceUnavailableError | None: + """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 + domain, 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: + Any | ServiceUnavailableError + """ + + 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/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 index 64d112c..642e897 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.email_domain_response import EmailDomainResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EmailDomainResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: """Run a verification check immediately ('Check now') Re-poll SES + DNS for this domain right now instead of waiting for the background verification @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +120,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: """Run a verification check immediately ('Check now') Re-poll SES + DNS for this domain right now instead of waiting for the background verification @@ -134,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -151,7 +157,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: +) -> Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError]: """Run a verification check immediately ('Check now') Re-poll SES + DNS for this domain right now instead of waiting for the background verification @@ -171,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EmailDomainResponse | HTTPValidationError] + Response[EmailDomainResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: +) -> EmailDomainResponse | HTTPValidationError | ServiceUnavailableError | None: """Run a verification check immediately ('Check now') Re-poll SES + DNS for this domain right now instead of waiting for the background verification @@ -211,7 +217,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EmailDomainResponse | HTTPValidationError + EmailDomainResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index ea9ef49..3ad3028 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.governance_ai_accept_response import GovernanceAiAcceptResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAcceptResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = GovernanceAiAcceptResponse.from_dict(response.json()) @@ -57,6 +64,11 @@ def _parse_response( 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: @@ -65,7 +77,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | GovernanceAiAcceptResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +94,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAcceptResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept a governance plan Execute the proposed policy changes from a governance AI assistant conversation. Each action is @@ -98,7 +114,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | GovernanceAiAcceptResponse | HTTPValidationError] + Response[Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -120,7 +136,13 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAcceptResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Accept a governance plan Execute the proposed policy changes from a governance AI assistant conversation. Each action is @@ -138,7 +160,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | GovernanceAiAcceptResponse | HTTPValidationError + Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +177,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAcceptResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept a governance plan Execute the proposed policy changes from a governance AI assistant conversation. Each action is @@ -173,7 +197,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | GovernanceAiAcceptResponse | HTTPValidationError] + Response[Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -193,7 +217,13 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAcceptResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Accept a governance plan Execute the proposed policy changes from a governance AI assistant conversation. Each action is @@ -211,7 +241,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | GovernanceAiAcceptResponse | HTTPValidationError + Any | GovernanceAiAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 9252846..46b8cea 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,7 +84,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline a governance plan Reject a previously proposed governance AI assistant plan without applying any changes. The @@ -96,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -118,7 +124,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline a governance plan Reject a previously proposed governance AI assistant plan without applying any changes. The @@ -136,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +159,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline a governance plan Reject a previously proposed governance AI assistant plan without applying any changes. The @@ -171,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline a governance plan Reject a previously proposed governance AI assistant plan without applying any changes. The @@ -209,7 +215,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index f13cda2..7c7c0e4 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.governance_ai_assistant_request import GovernanceAiAssistantRequest from ...models.governance_ai_assistant_response import GovernanceAiAssistantResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAssistantResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = GovernanceAiAssistantResponse.from_dict(response.json()) @@ -59,6 +66,11 @@ def _parse_response( 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: @@ -67,7 +79,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | GovernanceAiAssistantResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +96,9 @@ def sync_detailed( body: GovernanceAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAssistantResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a governance plan Send a natural-language request to the governance AI assistant to generate a plan of policy changes. @@ -100,7 +116,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | GovernanceAiAssistantResponse | HTTPValidationError] + Response[Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -122,7 +138,13 @@ def sync( body: GovernanceAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAssistantResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Generate a governance plan Send a natural-language request to the governance AI assistant to generate a plan of policy changes. @@ -140,7 +162,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | GovernanceAiAssistantResponse | HTTPValidationError + Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -157,7 +179,9 @@ async def asyncio_detailed( body: GovernanceAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAssistantResponse | HTTPValidationError]: +) -> Response[ + Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate a governance plan Send a natural-language request to the governance AI assistant to generate a plan of policy changes. @@ -175,7 +199,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | GovernanceAiAssistantResponse | HTTPValidationError] + Response[Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -195,7 +219,13 @@ async def asyncio( body: GovernanceAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: +) -> ( + Any + | GovernanceAiAssistantResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): """Generate a governance plan Send a natural-language request to the governance AI assistant to generate a plan of policy changes. @@ -213,7 +243,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | GovernanceAiAssistantResponse | HTTPValidationError + Any | GovernanceAiAssistantResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d6cc9f0..9a715b8 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.governance_conversation_response import GovernanceConversationResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -42,7 +43,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] + | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -64,6 +71,11 @@ def _parse_response( 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: @@ -72,7 +84,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,7 +104,12 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] +]: """List AI assistant conversations Return recent governance AI assistant conversations for the account, ordered by most recent first. @@ -104,7 +126,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | list[GovernanceConversationResponse]] + Response[Any | HTTPValidationError | ServiceUnavailableError | list[GovernanceConversationResponse]] """ kwargs = _get_kwargs( @@ -126,7 +148,13 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] + | None +): """List AI assistant conversations Return recent governance AI assistant conversations for the account, ordered by most recent first. @@ -143,7 +171,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | list[GovernanceConversationResponse] + Any | HTTPValidationError | ServiceUnavailableError | list[GovernanceConversationResponse] """ return sync_detailed( @@ -160,7 +188,12 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] +]: """List AI assistant conversations Return recent governance AI assistant conversations for the account, ordered by most recent first. @@ -177,7 +210,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | list[GovernanceConversationResponse]] + Response[Any | HTTPValidationError | ServiceUnavailableError | list[GovernanceConversationResponse]] """ kwargs = _get_kwargs( @@ -197,7 +230,13 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | list[GovernanceConversationResponse] + | None +): """List AI assistant conversations Return recent governance AI assistant conversations for the account, ordered by most recent first. @@ -214,7 +253,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | list[GovernanceConversationResponse] + Any | HTTPValidationError | ServiceUnavailableError | list[GovernanceConversationResponse] """ return ( diff --git a/seclai/_generated/api/identity/get_me_api_me_get.py b/seclai/_generated/api/identity/get_me_api_me_get.py index 89f9a28..059de06 100644 --- a/seclai/_generated/api/identity/get_me_api_me_get.py +++ b/seclai/_generated/api/identity/get_me_api_me_get.py @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.me_response import MeResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> MeResponse | None: +) -> MeResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = MeResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[MeResponse]: +) -> Response[MeResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[MeResponse]: +) -> Response[MeResponse | ServiceUnavailableError]: """Get current user identity Returns the authenticated user's personal account ID and a list of organisations they belong to. @@ -77,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[MeResponse] + Response[MeResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -97,7 +103,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> MeResponse | None: +) -> MeResponse | ServiceUnavailableError | None: """Get current user identity Returns the authenticated user's personal account ID and a list of organisations they belong to. @@ -113,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - MeResponse + MeResponse | ServiceUnavailableError """ return sync_detailed( @@ -128,7 +134,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[MeResponse]: +) -> Response[MeResponse | ServiceUnavailableError]: """Get current user identity Returns the authenticated user's personal account ID and a list of organisations they belong to. @@ -144,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[MeResponse] + Response[MeResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -162,7 +168,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> MeResponse | None: +) -> MeResponse | ServiceUnavailableError | None: """Get current user identity Returns the authenticated user's personal account ID and a list of organisations they belong to. @@ -178,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - MeResponse + MeResponse | ServiceUnavailableError """ return ( 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 index 0550f97..75fdb05 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.create_knowledge_base_body import CreateKnowledgeBaseBody from ...models.http_validation_error import HTTPValidationError from ...models.knowledge_base import KnowledgeBase +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | KnowledgeBase | None: +) -> Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: if response.status_code == 201: response_201 = KnowledgeBase.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | KnowledgeBase]: +) -> Response[Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,7 +84,7 @@ def sync_detailed( body: CreateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | KnowledgeBase]: +) -> Response[Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Create Knowledge Base Create a new knowledge base. @@ -95,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | KnowledgeBase] + Response[Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -117,7 +123,7 @@ def sync( body: CreateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | KnowledgeBase | None: +) -> Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Create Knowledge Base Create a new knowledge base. @@ -134,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | KnowledgeBase + Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return sync_detailed( @@ -151,7 +157,7 @@ async def asyncio_detailed( body: CreateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | KnowledgeBase]: +) -> Response[Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Create Knowledge Base Create a new knowledge base. @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | KnowledgeBase] + Response[Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( body: CreateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | KnowledgeBase | None: +) -> Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Create Knowledge Base Create a new knowledge base. @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | KnowledgeBase + Any | HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return ( 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 index 911e5e4..cad6484 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Knowledge Base Soft-delete a knowledge base. This action cannot be undone. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Knowledge Base Soft-delete a knowledge base. This action cannot be undone. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Knowledge Base Soft-delete a knowledge base. This action cannot be undone. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Knowledge Base Soft-delete a knowledge base. This action cannot be undone. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index eb5c7c6..6b89248 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.knowledge_base import KnowledgeBase +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: if response.status_code == 200: response_200 = KnowledgeBase.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Get Knowledge Base Fetch a knowledge base by ID. @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBase] + Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Get Knowledge Base Fetch a knowledge base by ID. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBase + HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Get Knowledge Base Fetch a knowledge base by ID. @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBase] + Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Get Knowledge Base Fetch a knowledge base by ID. @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBase + HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return ( 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 index b7abd30..d4ff44c 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.knowledge_base_list_response_model import KnowledgeBaseListResponseModel +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -51,7 +52,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: +) -> ( + HTTPValidationError + | KnowledgeBaseListResponseModel + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = KnowledgeBaseListResponseModel.from_dict(response.json()) @@ -62,6 +68,11 @@ def _parse_response( 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: @@ -70,7 +81,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: +) -> Response[ + HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,7 +101,9 @@ def sync_detailed( order: str | Unset = "desc", x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: +) -> Response[ + HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError +]: """List Knowledge Bases List knowledge bases for the account. @@ -111,7 +126,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBaseListResponseModel] + Response[HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -139,7 +154,12 @@ def sync( order: str | Unset = "desc", x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: +) -> ( + HTTPValidationError + | KnowledgeBaseListResponseModel + | ServiceUnavailableError + | None +): """List Knowledge Bases List knowledge bases for the account. @@ -162,7 +182,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBaseListResponseModel + HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError """ return sync_detailed( @@ -185,7 +205,9 @@ async def asyncio_detailed( order: str | Unset = "desc", x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: +) -> Response[ + HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError +]: """List Knowledge Bases List knowledge bases for the account. @@ -208,7 +230,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBaseListResponseModel] + Response[HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -234,7 +256,12 @@ async def asyncio( order: str | Unset = "desc", x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: +) -> ( + HTTPValidationError + | KnowledgeBaseListResponseModel + | ServiceUnavailableError + | None +): """List Knowledge Bases List knowledge bases for the account. @@ -257,7 +284,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBaseListResponseModel + HTTPValidationError | KnowledgeBaseListResponseModel | ServiceUnavailableError """ return ( 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 index e6b8395..d634338 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.knowledge_base import KnowledgeBase +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_knowledge_base_body import UpdateKnowledgeBaseBody from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: if response.status_code == 200: response_200 = KnowledgeBase.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Update Knowledge Base Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left @@ -100,7 +106,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBase] + Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -124,7 +130,7 @@ def sync( body: UpdateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Update Knowledge Base Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left @@ -145,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBase + HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return sync_detailed( @@ -164,7 +170,7 @@ async def asyncio_detailed( body: UpdateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: +) -> Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError]: """Update Knowledge Base Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left @@ -185,7 +191,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | KnowledgeBase] + Response[HTTPValidationError | KnowledgeBase | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -207,7 +213,7 @@ async def asyncio( body: UpdateKnowledgeBaseBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: +) -> HTTPValidationError | KnowledgeBase | ServiceUnavailableError | None: """Update Knowledge Base Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left @@ -228,7 +234,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | KnowledgeBase + HTTPValidationError | KnowledgeBase | ServiceUnavailableError """ return ( 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 index c78a7f0..0b2f2bf 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.compaction_scheduled_response import CompactionScheduledResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionScheduledResponse | HTTPValidationError | None: +) -> CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 202: response_202 = CompactionScheduledResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionScheduledResponse | HTTPValidationError]: +) -> Response[ + CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,13 +80,16 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionScheduledResponse | HTTPValidationError]: +) -> Response[ + CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError +]: """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. + The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age + no longer triggers compaction — use retention_days to remove entries by age. Compaction runs + asynchronously — the response confirms scheduling, not completion. Args: memory_bank_id (str): @@ -90,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionScheduledResponse | HTTPValidationError] + Response[CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -112,13 +123,14 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionScheduledResponse | HTTPValidationError | None: +) -> CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError | 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. + The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age + no longer triggers compaction — use retention_days to remove entries by age. Compaction runs + asynchronously — the response confirms scheduling, not completion. Args: memory_bank_id (str): @@ -130,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionScheduledResponse | HTTPValidationError + CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -147,13 +159,16 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionScheduledResponse | HTTPValidationError]: +) -> Response[ + CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError +]: """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. + The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age + no longer triggers compaction — use retention_days to remove entries by age. Compaction runs + asynchronously — the response confirms scheduling, not completion. Args: memory_bank_id (str): @@ -165,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionScheduledResponse | HTTPValidationError] + Response[CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -185,13 +200,14 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionScheduledResponse | HTTPValidationError | None: +) -> CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError | 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. + The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age + no longer triggers compaction — use retention_days to remove entries by age. Compaction runs + asynchronously — the response confirms scheduling, not completion. Args: memory_bank_id (str): @@ -203,7 +219,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionScheduledResponse | HTTPValidationError + CompactionScheduledResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 9953a07..9712004 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.create_memory_bank_body import CreateMemoryBankBody from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank import MemoryBank +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: if response.status_code == 201: response_201 = MemoryBank.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: CreateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Create Memory Bank Create a new memory bank. @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +120,7 @@ def sync( body: CreateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Create Memory Bank Create a new memory bank. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( body: CreateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Create Memory Bank Create a new memory bank. @@ -167,7 +173,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +193,7 @@ async def asyncio( body: CreateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Create Memory Bank Create a new memory bank. @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return ( 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 index 4ad3519..4e2bc7b 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Memory Bank Soft-delete a memory bank. This action is permanent and cannot be undone. @@ -87,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -109,7 +115,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Memory Bank Soft-delete a memory bank. This action is permanent and cannot be undone. @@ -126,7 +132,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -143,7 +149,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Memory Bank Soft-delete a memory bank. This action is permanent and cannot be undone. @@ -160,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -180,7 +186,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Memory Bank Soft-delete a memory bank. This action is permanent and cannot be undone. @@ -197,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 9227dcd..3bf9a56 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Memory Bank Source Delete the content source linked to a memory bank, removing all stored memory entries. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Memory Bank Source Delete the content source linked to a memory bank, removing all stored memory entries. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Memory Bank Source Delete the content source linked to a memory bank, removing all stored memory entries. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Memory Bank Source Delete the content source linked to a memory bank, removing all stored memory entries. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 5598220..b9f667d 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = response.json() return response_200 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Get Agents Using Bank List agents whose current definition references this memory bank. @@ -87,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -109,7 +115,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Get Agents Using Bank List agents whose current definition references this memory bank. @@ -126,7 +132,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -143,7 +149,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Get Agents Using Bank List agents whose current definition references this memory bank. @@ -160,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -180,7 +186,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Get Agents Using Bank List agents whose current definition references this memory bank. @@ -197,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 9597be3..4e66ec8 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank import MemoryBank +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: if response.status_code == 200: response_200 = MemoryBank.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Get Memory Bank Fetch a memory bank by ID. @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Get Memory Bank Fetch a memory bank by ID. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Get Memory Bank Fetch a memory bank by ID. @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Get Memory Bank Fetch a memory bank by ID. @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return ( 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 index 0f47ac0..34db2f5 100644 --- 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 @@ -12,6 +12,7 @@ GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet, ) from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -72,6 +73,7 @@ def _parse_response( ) -> ( GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError | None ): if response.status_code == 200: @@ -86,6 +88,11 @@ def _parse_response( 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: @@ -97,6 +104,7 @@ def _build_response( ) -> Response[ GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError ]: return Response( status_code=HTTPStatus(response.status_code), @@ -118,6 +126,7 @@ def sync_detailed( ) -> Response[ GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError ]: """Get Memory Bank Entry Stats @@ -138,7 +147,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError] + Response[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -169,6 +178,7 @@ def sync( ) -> ( GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError | None ): """Get Memory Bank Entry Stats @@ -190,7 +200,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -216,6 +226,7 @@ async def asyncio_detailed( ) -> Response[ GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError ]: """Get Memory Bank Entry Stats @@ -236,7 +247,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError] + Response[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -265,6 +276,7 @@ async def asyncio( ) -> ( GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + | ServiceUnavailableError | None ): """Get Memory Bank Entry Stats @@ -286,7 +298,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError + GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 3c2e752..a2ace43 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank_list_response_model import MemoryBankListResponseModel +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -59,7 +60,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankListResponseModel | None: +) -> HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError | None: if response.status_code == 200: response_200 = MemoryBankListResponseModel.from_dict(response.json()) @@ -70,6 +71,11 @@ def _parse_response( 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: @@ -78,7 +84,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: +) -> Response[ + HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +105,9 @@ def sync_detailed( type_: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: +) -> Response[ + HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError +]: """List Memory Banks List memory banks for the account. @@ -121,7 +131,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankListResponseModel] + Response[HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -151,7 +161,7 @@ def sync( type_: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankListResponseModel | None: +) -> HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError | None: """List Memory Banks List memory banks for the account. @@ -175,7 +185,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankListResponseModel + HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError """ return sync_detailed( @@ -200,7 +210,9 @@ async def asyncio_detailed( type_: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: +) -> Response[ + HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError +]: """List Memory Banks List memory banks for the account. @@ -224,7 +236,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankListResponseModel] + Response[HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -252,7 +264,7 @@ async def asyncio( type_: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankListResponseModel | None: +) -> HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError | None: """List Memory Banks List memory banks for the account. @@ -276,7 +288,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankListResponseModel + HTTPValidationError | MemoryBankListResponseModel | ServiceUnavailableError """ return ( 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 index 2f13e03..1a1adfa 100644 --- 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 @@ -6,6 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -32,9 +33,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: +) -> Any | ServiceUnavailableError | None: if response.status_code == 200: - return None + response_200 = response.json() + return response_200 + + 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) @@ -44,7 +51,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +65,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: """List Templates Return pre-built template configurations for common memory bank use cases. @@ -75,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -90,12 +97,44 @@ def sync_detailed( return _build_response(client=client, response=response) +def sync( + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Any | ServiceUnavailableError | None: + """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: + Any | ServiceUnavailableError + """ + + 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[Any]: +) -> Response[Any | ServiceUnavailableError]: """List Templates Return pre-built template configurations for common memory bank use cases. @@ -112,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,3 +162,37 @@ async def asyncio_detailed( 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, +) -> Any | ServiceUnavailableError | None: + """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: + Any | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed 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 index 342ebbc..de61022 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank_accept_request import MemoryBankAcceptRequest from ...models.ok_response import OkResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = OkResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -99,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +129,7 @@ def sync( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -143,7 +149,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +168,7 @@ async def asyncio_detailed( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: +) -> Response[HTTPValidationError | OkResponse | ServiceUnavailableError]: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -182,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | OkResponse] + Response[HTTPValidationError | OkResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +210,7 @@ async def asyncio( body: MemoryBankAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: +) -> HTTPValidationError | OkResponse | ServiceUnavailableError | None: """Accept or decline a memory bank AI suggestion Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to @@ -224,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | OkResponse + HTTPValidationError | OkResponse | ServiceUnavailableError """ return ( 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 index 5701975..ec64985 100644 --- 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 @@ -9,6 +9,7 @@ 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 ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + Any + | HTTPValidationError + | MemoryBankAiAssistantResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = MemoryBankAiAssistantResponse.from_dict(response.json()) @@ -55,6 +62,11 @@ def _parse_response( 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: @@ -63,7 +75,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,7 +92,9 @@ def sync_detailed( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: """Generate a memory bank configuration Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -96,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse] + Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -118,7 +134,13 @@ def sync( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + Any + | HTTPValidationError + | MemoryBankAiAssistantResponse + | ServiceUnavailableError + | None +): """Generate a memory bank configuration Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -136,7 +158,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | MemoryBankAiAssistantResponse + Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +175,9 @@ async def asyncio_detailed( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: +) -> Response[ + Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError +]: """Generate a memory bank configuration Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -171,7 +195,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse] + Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +215,13 @@ async def asyncio( body: MemoryBankAiAssistantRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: +) -> ( + Any + | HTTPValidationError + | MemoryBankAiAssistantResponse + | ServiceUnavailableError + | None +): """Generate a memory bank configuration Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, @@ -209,7 +239,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | MemoryBankAiAssistantResponse + Any | HTTPValidationError | MemoryBankAiAssistantResponse | ServiceUnavailableError """ return ( 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 index 591ba3f..df8209d 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.memory_bank_last_conversation_response import ( MemoryBankLastConversationResponse, ) +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -47,7 +48,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: response_200 = MemoryBankLastConversationResponse.from_dict(response.json()) @@ -58,6 +64,11 @@ def _parse_response( 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: @@ -66,7 +77,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +95,9 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports @@ -101,7 +116,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankLastConversationResponse] + Response[HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -125,7 +140,12 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports @@ -144,7 +164,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankLastConversationResponse + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError """ return sync_detailed( @@ -163,7 +183,9 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: +) -> Response[ + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError +]: """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports @@ -182,7 +204,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBankLastConversationResponse] + Response[HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +226,12 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: +) -> ( + HTTPValidationError + | MemoryBankLastConversationResponse + | ServiceUnavailableError + | None +): """Fetch memory bank AI conversation history Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports @@ -223,7 +250,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBankLastConversationResponse + HTTPValidationError | MemoryBankLastConversationResponse | ServiceUnavailableError """ return ( 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 index 68ce20b..c6df978 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.compaction_test_response_model import CompactionTestResponseModel from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.test_compaction_request import TestCompactionRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CompactionTestResponseModel.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: TestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: """Test Compaction Prompt Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -109,7 +119,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionTestResponseModel | HTTPValidationError] + Response[CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -133,7 +143,7 @@ def sync( body: TestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: """Test Compaction Prompt Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -163,7 +173,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionTestResponseModel | HTTPValidationError + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -182,7 +192,9 @@ async def asyncio_detailed( body: TestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: """Test Compaction Prompt Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -212,7 +224,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionTestResponseModel | HTTPValidationError] + Response[CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -234,7 +246,7 @@ async def asyncio( body: TestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: """Test Compaction Prompt Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -264,7 +276,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionTestResponseModel | HTTPValidationError + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d4096b4..ebf28bb 100644 --- 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 @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.compaction_test_response_model import CompactionTestResponseModel from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.standalone_test_compaction_request import StandaloneTestCompactionRequest from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CompactionTestResponseModel.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +82,9 @@ def sync_detailed( body: StandaloneTestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: """Test Compaction Prompt Standalone Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -97,7 +107,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionTestResponseModel | HTTPValidationError] + Response[CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -119,7 +129,7 @@ def sync( body: StandaloneTestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: """Test Compaction Prompt Standalone Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -142,7 +152,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionTestResponseModel | HTTPValidationError + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -159,7 +169,9 @@ async def asyncio_detailed( body: StandaloneTestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: +) -> Response[ + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError +]: """Test Compaction Prompt Standalone Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -182,7 +194,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CompactionTestResponseModel | HTTPValidationError] + Response[CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -202,7 +214,7 @@ async def asyncio( body: StandaloneTestCompactionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: +) -> CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError | None: """Test Compaction Prompt Standalone Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. @@ -225,7 +237,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CompactionTestResponseModel | HTTPValidationError + CompactionTestResponseModel | HTTPValidationError | ServiceUnavailableError """ return ( 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 index ea1c237..18cd4eb 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.memory_bank import MemoryBank +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_memory_bank_body import UpdateMemoryBankBody from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: if response.status_code == 200: response_200 = MemoryBank.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Update Memory Bank Update a memory bank's configuration. Only provided fields are changed; omitted fields are left @@ -102,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -126,7 +132,7 @@ def sync( body: UpdateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Update Memory Bank Update a memory bank's configuration. Only provided fields are changed; omitted fields are left @@ -149,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return sync_detailed( @@ -168,7 +174,7 @@ async def asyncio_detailed( body: UpdateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: +) -> Response[HTTPValidationError | MemoryBank | ServiceUnavailableError]: """Update Memory Bank Update a memory bank's configuration. Only provided fields are changed; omitted fields are left @@ -191,7 +197,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MemoryBank] + Response[HTTPValidationError | MemoryBank | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -213,7 +219,7 @@ async def asyncio( body: UpdateMemoryBankBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: +) -> HTTPValidationError | MemoryBank | ServiceUnavailableError | None: """Update Memory Bank Update a memory bank's configuration. Only provided fields are changed; omitted fields are left @@ -236,7 +242,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MemoryBank + HTTPValidationError | MemoryBank | ServiceUnavailableError """ return ( 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 89bc106..fc7efb5 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.cancel_experiment_response import CancelExperimentResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelExperimentResponse | HTTPValidationError | None: +) -> CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CancelExperimentResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelExperimentResponse | HTTPValidationError]: +) -> Response[CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CancelExperimentResponse | HTTPValidationError]: +) -> Response[CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError]: """Cancel Experiment Endpoint Cancel a running or pending model playground experiment. @@ -81,7 +87,7 @@ def sync_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -93,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelExperimentResponse | HTTPValidationError] + Response[CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -115,7 +121,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CancelExperimentResponse | HTTPValidationError | None: +) -> CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: """Cancel Experiment Endpoint Cancel a running or pending model playground experiment. @@ -124,7 +130,7 @@ def sync( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -136,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelExperimentResponse | HTTPValidationError + CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -153,7 +159,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CancelExperimentResponse | HTTPValidationError]: +) -> Response[CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError]: """Cancel Experiment Endpoint Cancel a running or pending model playground experiment. @@ -162,7 +168,7 @@ async def asyncio_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -174,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelExperimentResponse | HTTPValidationError] + Response[CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -194,7 +200,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CancelExperimentResponse | HTTPValidationError | None: +) -> CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: """Cancel Experiment Endpoint Cancel a running or pending model playground experiment. @@ -203,7 +209,7 @@ async def asyncio( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -215,7 +221,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelExperimentResponse | HTTPValidationError + CancelExperimentResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index cf6e09c..d9ebf94 100644 --- 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 @@ -9,6 +9,7 @@ from ...models.create_experiment_response import CreateExperimentResponse from ...models.http_validation_error import HTTPValidationError from ...models.playground_create_request import PlaygroundCreateRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateExperimentResponse | HTTPValidationError | None: +) -> CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = CreateExperimentResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateExperimentResponse | HTTPValidationError]: +) -> Response[CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: PlaygroundCreateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CreateExperimentResponse | HTTPValidationError]: +) -> Response[CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError]: """Create Experiment Create and schedule a model playground experiment. @@ -84,6 +90,8 @@ def sync_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. + - When the credential is bound to a user, the experiment belongs to that user; only that user or an + account-scoped key can cancel or delete it. Args: x_account_id (UUID | Unset): @@ -95,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateExperimentResponse | HTTPValidationError] + Response[CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -117,7 +125,7 @@ def sync( body: PlaygroundCreateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CreateExperimentResponse | HTTPValidationError | None: +) -> CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Experiment Create and schedule a model playground experiment. @@ -127,6 +135,8 @@ def sync( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. + - When the credential is bound to a user, the experiment belongs to that user; only that user or an + account-scoped key can cancel or delete it. Args: x_account_id (UUID | Unset): @@ -138,7 +148,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateExperimentResponse | HTTPValidationError + CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +165,7 @@ async def asyncio_detailed( body: PlaygroundCreateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[CreateExperimentResponse | HTTPValidationError]: +) -> Response[CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError]: """Create Experiment Create and schedule a model playground experiment. @@ -165,6 +175,8 @@ async def asyncio_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. + - When the credential is bound to a user, the experiment belongs to that user; only that user or an + account-scoped key can cancel or delete it. Args: x_account_id (UUID | Unset): @@ -176,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateExperimentResponse | HTTPValidationError] + Response[CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -196,7 +208,7 @@ async def asyncio( body: PlaygroundCreateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> CreateExperimentResponse | HTTPValidationError | None: +) -> CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError | None: """Create Experiment Create and schedule a model playground experiment. @@ -206,6 +218,8 @@ async def asyncio( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. + - When the credential is bound to a user, the experiment belongs to that user; only that user or an + account-scoped key can cancel or delete it. Args: x_account_id (UUID | Unset): @@ -217,7 +231,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateExperimentResponse | HTTPValidationError + CreateExperimentResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 0e6b53f..d79cd9d 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Experiment Endpoint Soft-delete a model playground experiment. @@ -79,7 +85,7 @@ def sync_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Experiment Endpoint Soft-delete a model playground experiment. @@ -122,7 +128,7 @@ def sync( Auth & scoping: - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -134,7 +140,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -151,7 +157,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Experiment Endpoint Soft-delete a model playground experiment. @@ -160,7 +166,7 @@ async def asyncio_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -172,7 +178,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -192,7 +198,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Experiment Endpoint Soft-delete a model playground experiment. @@ -201,7 +207,7 @@ async def asyncio( Auth & scoping: - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -213,7 +219,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 25a65f1..75bf483 100644 --- 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 @@ -6,6 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.unread_count_response import UnreadCountResponse from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> UnreadCountResponse | None: +) -> ServiceUnavailableError | UnreadCountResponse | None: if response.status_code == 200: response_200 = UnreadCountResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[UnreadCountResponse]: +) -> Response[ServiceUnavailableError | UnreadCountResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[UnreadCountResponse]: +) -> Response[ServiceUnavailableError | UnreadCountResponse]: """Get Alert Unread Count Get the count of unread model lifecycle alerts. @@ -80,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UnreadCountResponse] + Response[ServiceUnavailableError | UnreadCountResponse] """ kwargs = _get_kwargs( @@ -100,7 +106,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> UnreadCountResponse | None: +) -> ServiceUnavailableError | UnreadCountResponse | None: """Get Alert Unread Count Get the count of unread model lifecycle alerts. @@ -119,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UnreadCountResponse + ServiceUnavailableError | UnreadCountResponse """ return sync_detailed( @@ -134,7 +140,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[UnreadCountResponse]: +) -> Response[ServiceUnavailableError | UnreadCountResponse]: """Get Alert Unread Count Get the count of unread model lifecycle alerts. @@ -153,7 +159,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UnreadCountResponse] + Response[ServiceUnavailableError | UnreadCountResponse] """ kwargs = _get_kwargs( @@ -171,7 +177,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> UnreadCountResponse | None: +) -> ServiceUnavailableError | UnreadCountResponse | None: """Get Alert Unread Count Get the count of unread model lifecycle alerts. @@ -190,7 +196,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UnreadCountResponse + ServiceUnavailableError | UnreadCountResponse """ return ( 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 index 4c59601..46cac40 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.experiment_detail_response import ExperimentDetailResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExperimentDetailResponse | HTTPValidationError | None: +) -> ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ExperimentDetailResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExperimentDetailResponse | HTTPValidationError]: +) -> Response[ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExperimentDetailResponse | HTTPValidationError]: +) -> Response[ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get Experiment Get details and results for a specific model playground experiment. @@ -82,7 +88,7 @@ def sync_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -94,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExperimentDetailResponse | HTTPValidationError] + Response[ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExperimentDetailResponse | HTTPValidationError | None: +) -> ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get Experiment Get details and results for a specific model playground experiment. @@ -126,7 +132,7 @@ def sync( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -138,7 +144,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExperimentDetailResponse | HTTPValidationError + ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -155,7 +161,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExperimentDetailResponse | HTTPValidationError]: +) -> Response[ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError]: """Get Experiment Get details and results for a specific model playground experiment. @@ -165,7 +171,7 @@ async def asyncio_detailed( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -177,7 +183,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExperimentDetailResponse | HTTPValidationError] + Response[ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -197,7 +203,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExperimentDetailResponse | HTTPValidationError | None: +) -> ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError | None: """Get Experiment Get details and results for a specific model playground experiment. @@ -207,7 +213,7 @@ async def asyncio( Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. + account and, when the credential is bound to a user, to that user; otherwise 404. Args: experiment_id (UUID): @@ -219,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExperimentDetailResponse | HTTPValidationError + ExperimentDetailResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 1fda8e9..48846d3 100644 --- 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 @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.generation_tier_list_response import GenerationTierListResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerationTierListResponse | None: +) -> GenerationTierListResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = GenerationTierListResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerationTierListResponse]: +) -> Response[GenerationTierListResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerationTierListResponse]: +) -> Response[GenerationTierListResponse | ServiceUnavailableError]: """Get Generation Tiers List the media-generation quality tiers and the model + cost each resolves to. @@ -84,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerationTierListResponse] + Response[GenerationTierListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -104,7 +110,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerationTierListResponse | None: +) -> GenerationTierListResponse | ServiceUnavailableError | None: """Get Generation Tiers List the media-generation quality tiers and the model + cost each resolves to. @@ -127,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerationTierListResponse + GenerationTierListResponse | ServiceUnavailableError """ return sync_detailed( @@ -142,7 +148,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[GenerationTierListResponse]: +) -> Response[GenerationTierListResponse | ServiceUnavailableError]: """Get Generation Tiers List the media-generation quality tiers and the model + cost each resolves to. @@ -165,7 +171,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerationTierListResponse] + Response[GenerationTierListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> GenerationTierListResponse | None: +) -> GenerationTierListResponse | ServiceUnavailableError | None: """Get Generation Tiers List the media-generation quality tiers and the model + cost each resolves to. @@ -206,7 +212,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerationTierListResponse + GenerationTierListResponse | ServiceUnavailableError """ return ( 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 index 45bf1fb..b190317 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.prompt_model_response import PromptModelResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | PromptModelResponse | None: +) -> HTTPValidationError | PromptModelResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = PromptModelResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | PromptModelResponse]: +) -> Response[HTTPValidationError | PromptModelResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | PromptModelResponse]: +) -> Response[HTTPValidationError | PromptModelResponse | ServiceUnavailableError]: """Get Model Get detailed information about a specific model. @@ -95,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | PromptModelResponse] + Response[HTTPValidationError | PromptModelResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -117,7 +123,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | PromptModelResponse | None: +) -> HTTPValidationError | PromptModelResponse | ServiceUnavailableError | None: """Get Model Get detailed information about a specific model. @@ -140,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | PromptModelResponse + HTTPValidationError | PromptModelResponse | ServiceUnavailableError """ return sync_detailed( @@ -157,7 +163,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | PromptModelResponse]: +) -> Response[HTTPValidationError | PromptModelResponse | ServiceUnavailableError]: """Get Model Get detailed information about a specific model. @@ -180,7 +186,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | PromptModelResponse] + Response[HTTPValidationError | PromptModelResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -200,7 +206,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | PromptModelResponse | None: +) -> HTTPValidationError | PromptModelResponse | ServiceUnavailableError | None: """Get Model Get detailed information about a specific model. @@ -223,7 +229,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | PromptModelResponse + HTTPValidationError | PromptModelResponse | ServiceUnavailableError """ return ( 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 index e58a035..f45e9e1 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.model_recommendations_response import ModelRecommendationsResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -83,7 +84,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | ModelRecommendationsResponse | None: +) -> ( + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError | None +): if response.status_code == 200: response_200 = ModelRecommendationsResponse.from_dict(response.json()) @@ -94,6 +97,11 @@ def _parse_response( 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: @@ -102,7 +110,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: +) -> Response[ + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,7 +132,9 @@ def sync_detailed( min_output_tokens: int | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: +) -> Response[ + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError +]: """Get Recommendations Get replacement/upgrade recommendations for a model. @@ -150,7 +162,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | ModelRecommendationsResponse] + Response[HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -182,7 +194,9 @@ def sync( min_output_tokens: int | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelRecommendationsResponse | None: +) -> ( + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError | None +): """Get Recommendations Get replacement/upgrade recommendations for a model. @@ -210,7 +224,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | ModelRecommendationsResponse + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError """ return sync_detailed( @@ -237,7 +251,9 @@ async def asyncio_detailed( min_output_tokens: int | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: +) -> Response[ + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError +]: """Get Recommendations Get replacement/upgrade recommendations for a model. @@ -265,7 +281,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | ModelRecommendationsResponse] + Response[HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -295,7 +311,9 @@ async def asyncio( min_output_tokens: int | None | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelRecommendationsResponse | None: +) -> ( + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError | None +): """Get Recommendations Get replacement/upgrade recommendations for a model. @@ -323,7 +341,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | ModelRecommendationsResponse + HTTPValidationError | ModelRecommendationsResponse | ServiceUnavailableError """ return ( 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 index 64735a7..59a766c 100644 --- a/seclai/_generated/api/models/list_alerts_api_models_alerts_get.py +++ b/seclai/_generated/api/models/list_alerts_api_models_alerts_get.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.model_alert_list_response import ModelAlertListResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -56,7 +57,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | ModelAlertListResponse | None: +) -> HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ModelAlertListResponse.from_dict(response.json()) @@ -67,6 +68,11 @@ def _parse_response( 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: @@ -75,7 +81,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | ModelAlertListResponse]: +) -> Response[HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,7 +99,7 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelAlertListResponse]: +) -> Response[HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError]: """List Alerts List model lifecycle alerts for the account. @@ -117,7 +123,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | ModelAlertListResponse] + Response[HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -145,7 +151,7 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelAlertListResponse | None: +) -> HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError | None: """List Alerts List model lifecycle alerts for the account. @@ -169,7 +175,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | ModelAlertListResponse + HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError """ return sync_detailed( @@ -192,7 +198,7 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelAlertListResponse]: +) -> Response[HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError]: """List Alerts List model lifecycle alerts for the account. @@ -216,7 +222,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | ModelAlertListResponse] + Response[HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -242,7 +248,7 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelAlertListResponse | None: +) -> HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError | None: """List Alerts List model lifecycle alerts for the account. @@ -266,7 +272,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | ModelAlertListResponse + HTTPValidationError | ModelAlertListResponse | ServiceUnavailableError """ return ( 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 new file mode 100644 index 0000000..11694f3 --- /dev/null +++ b/seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py @@ -0,0 +1,313 @@ +from http import HTTPStatus +from typing import Any +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.embedding_model_list_response import EmbeddingModelListResponse +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + supports_input_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_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 + + 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/embedders", + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = EmbeddingModelListResponse.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[ + EmbeddingModelListResponse | 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( + *, + client: AuthenticatedClient | Client, + supports_input_media: None | str | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List Embedding Models + + List the embedding models a source can be created with. + + 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. + + 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 + embedder bills differently. + + An embedder whose credit rate has not been published yet is omitted, so you are never offered one + that cannot be billed. + + Optional query parameters: + - `supports_input_media`: keep only embedders that can index this modality + (`text`/`image`/`video`/`audio` or a full MIME) + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every account. + + Args: + supports_input_media (None | str | Unset): Filter to embedders that can index this input + modality — a coarse kind (text, image, video, audio) or a full MIME. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + supports_input_media=supports_input_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, + supports_input_media: None | str | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError | None: + """List Embedding Models + + List the embedding models a source can be created with. + + 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. + + 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 + embedder bills differently. + + An embedder whose credit rate has not been published yet is omitted, so you are never offered one + that cannot be billed. + + Optional query parameters: + - `supports_input_media`: keep only embedders that can index this modality + (`text`/`image`/`video`/`audio` or a full MIME) + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every account. + + Args: + supports_input_media (None | str | Unset): Filter to embedders that can index this input + modality — a coarse kind (text, image, video, audio) or a full MIME. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + client=client, + supports_input_media=supports_input_media, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + supports_input_media: None | str | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List Embedding Models + + List the embedding models a source can be created with. + + 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. + + 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 + embedder bills differently. + + An embedder whose credit rate has not been published yet is omitted, so you are never offered one + that cannot be billed. + + Optional query parameters: + - `supports_input_media`: keep only embedders that can index this modality + (`text`/`image`/`video`/`audio` or a full MIME) + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every account. + + Args: + supports_input_media (None | str | Unset): Filter to embedders that can index this input + modality — a coarse kind (text, image, video, audio) or a full MIME. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + supports_input_media=supports_input_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, + supports_input_media: None | str | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError | None: + """List Embedding Models + + List the embedding models a source can be created with. + + 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. + + 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 + embedder bills differently. + + An embedder whose credit rate has not been published yet is omitted, so you are never offered one + that cannot be billed. + + Optional query parameters: + - `supports_input_media`: keep only embedders that can index this modality + (`text`/`image`/`video`/`audio` or a full MIME) + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every account. + + Args: + supports_input_media (None | str | Unset): Filter to embedders that can index this input + modality — a coarse kind (text, image, video, audio) or a full MIME. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EmbeddingModelListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + client=client, + supports_input_media=supports_input_media, + 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 index 3c94f7d..60005a3 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.experiment_list_response import ExperimentListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -69,7 +70,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExperimentListResponse | HTTPValidationError | None: +) -> ExperimentListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ExperimentListResponse.from_dict(response.json()) @@ -80,6 +81,11 @@ def _parse_response( 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: @@ -88,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExperimentListResponse | HTTPValidationError]: +) -> Response[ExperimentListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -107,7 +113,7 @@ def sync_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExperimentListResponse | HTTPValidationError]: +) -> Response[ExperimentListResponse | HTTPValidationError | ServiceUnavailableError]: """List Experiments List model playground experiments for the account. @@ -115,7 +121,8 @@ def sync_detailed( 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. + - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account + and, when the credential is bound to a user, to that user. Args: days (int | Unset): Look-back window in days. Default: 30. @@ -131,7 +138,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExperimentListResponse | HTTPValidationError] + Response[ExperimentListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -161,7 +168,7 @@ def sync( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExperimentListResponse | HTTPValidationError | None: +) -> ExperimentListResponse | HTTPValidationError | ServiceUnavailableError | None: """List Experiments List model playground experiments for the account. @@ -169,7 +176,8 @@ def sync( 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. + - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account + and, when the credential is bound to a user, to that user. Args: days (int | Unset): Look-back window in days. Default: 30. @@ -185,7 +193,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExperimentListResponse | HTTPValidationError + ExperimentListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -210,7 +218,7 @@ async def asyncio_detailed( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExperimentListResponse | HTTPValidationError]: +) -> Response[ExperimentListResponse | HTTPValidationError | ServiceUnavailableError]: """List Experiments List model playground experiments for the account. @@ -218,7 +226,8 @@ async def asyncio_detailed( 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. + - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account + and, when the credential is bound to a user, to that user. Args: days (int | Unset): Look-back window in days. Default: 30. @@ -234,7 +243,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExperimentListResponse | HTTPValidationError] + Response[ExperimentListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -262,7 +271,7 @@ async def asyncio( offset: int | Unset = 0, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExperimentListResponse | HTTPValidationError | None: +) -> ExperimentListResponse | HTTPValidationError | ServiceUnavailableError | None: """List Experiments List model playground experiments for the account. @@ -270,7 +279,8 @@ async def asyncio( 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. + - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account + and, when the credential is bound to a user, to that user. Args: days (int | Unset): Look-back window in days. Default: 30. @@ -286,7 +296,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExperimentListResponse | HTTPValidationError + ExperimentListResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/models/list_models_api_models_get.py b/seclai/_generated/api/models/list_models_api_models_get.py index 89197e2..e2592be 100644 --- a/seclai/_generated/api/models/list_models_api_models_get.py +++ b/seclai/_generated/api/models/list_models_api_models_get.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.provider_group_response import ProviderGroupResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -79,7 +80,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[ProviderGroupResponse] | None: +) -> HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] | None: if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -95,6 +96,11 @@ def _parse_response( 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: @@ -103,7 +109,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,14 +130,20 @@ def sync_detailed( supports_output_media: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] +]: """List Models - List all enabled LLM models with full details. + List the enabled LLM models with full details. Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + A model whose credit rate has not been published yet is omitted, so you are never offered a model + that cannot be billed and therefore cannot be run. Such a model may appear later without any other + change. + Optional query parameters: - `provider`: filter by provider (e.g. 'anthropic', 'openai') - `supports_tool_use`: filter to models with tool calling support @@ -159,7 +173,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[ProviderGroupResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse]] """ kwargs = _get_kwargs( @@ -189,14 +203,18 @@ def sync( supports_output_media: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[ProviderGroupResponse] | None: +) -> HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] | None: """List Models - List all enabled LLM models with full details. + List the enabled LLM models with full details. Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + A model whose credit rate has not been published yet is omitted, so you are never offered a model + that cannot be billed and therefore cannot be run. Such a model may appear later without any other + change. + Optional query parameters: - `provider`: filter by provider (e.g. 'anthropic', 'openai') - `supports_tool_use`: filter to models with tool calling support @@ -226,7 +244,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[ProviderGroupResponse] + HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] """ return sync_detailed( @@ -251,14 +269,20 @@ async def asyncio_detailed( supports_output_media: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] +]: """List Models - List all enabled LLM models with full details. + List the enabled LLM models with full details. Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + A model whose credit rate has not been published yet is omitted, so you are never offered a model + that cannot be billed and therefore cannot be run. Such a model may appear later without any other + change. + Optional query parameters: - `provider`: filter by provider (e.g. 'anthropic', 'openai') - `supports_tool_use`: filter to models with tool calling support @@ -288,7 +312,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[ProviderGroupResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse]] """ kwargs = _get_kwargs( @@ -316,14 +340,18 @@ async def asyncio( supports_output_media: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[ProviderGroupResponse] | None: +) -> HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] | None: """List Models - List all enabled LLM models with full details. + List the enabled LLM models with full details. Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + A model whose credit rate has not been published yet is omitted, so you are never offered a model + that cannot be billed and therefore cannot be run. Such a model may appear later without any other + change. + Optional query parameters: - `provider`: filter by provider (e.g. 'anthropic', 'openai') - `supports_tool_use`: filter to models with tool calling support @@ -353,7 +381,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[ProviderGroupResponse] + HTTPValidationError | ServiceUnavailableError | list[ProviderGroupResponse] """ return ( diff --git a/seclai/_generated/api/models/list_reranker_models_api_models_rerankers_get.py b/seclai/_generated/api/models/list_reranker_models_api_models_rerankers_get.py new file mode 100644 index 0000000..56bbe44 --- /dev/null +++ b/seclai/_generated/api/models/list_reranker_models_api_models_rerankers_get.py @@ -0,0 +1,236 @@ +from http import HTTPStatus +from typing import Any +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.reranker_model_list_response import RerankerModelListResponse +from ...models.service_unavailable_error import ServiceUnavailableError +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/rerankers", + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RerankerModelListResponse | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = RerankerModelListResponse.from_dict(response.json()) + + return response_200 + + 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[RerankerModelListResponse | 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( + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[RerankerModelListResponse | ServiceUnavailableError]: + r"""List Reranker Models + + List the reranker models a knowledge base can be created with. + + A reranker re-scores the top results of a vector search for relevance. Each entry carries the + `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether + it is the platform default (`is_default`, used when you omit `reranker_model`). + + To disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value + from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — + whose chunks carry no text — defaults to no reranker. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every 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[RerankerModelListResponse | ServiceUnavailableError] + """ + + 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, +) -> RerankerModelListResponse | ServiceUnavailableError | None: + r"""List Reranker Models + + List the reranker models a knowledge base can be created with. + + A reranker re-scores the top results of a vector search for relevance. Each entry carries the + `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether + it is the platform default (`is_default`, used when you omit `reranker_model`). + + To disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value + from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — + whose chunks carry no text — defaults to no reranker. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every 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: + RerankerModelListResponse | ServiceUnavailableError + """ + + 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[RerankerModelListResponse | ServiceUnavailableError]: + r"""List Reranker Models + + List the reranker models a knowledge base can be created with. + + A reranker re-scores the top results of a vector search for relevance. Each entry carries the + `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether + it is the platform default (`is_default`, used when you omit `reranker_model`). + + To disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value + from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — + whose chunks carry no text — defaults to no reranker. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every 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[RerankerModelListResponse | ServiceUnavailableError] + """ + + 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, +) -> RerankerModelListResponse | ServiceUnavailableError | None: + r"""List Reranker Models + + List the reranker models a knowledge base can be created with. + + A reranker re-scores the top results of a vector search for relevance. Each entry carries the + `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether + it is the platform default (`is_default`, used when you omit `reranker_model`). + + To disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value + from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — + whose chunks carry no text — defaults to no reranker. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical + for every 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: + RerankerModelListResponse | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + client=client, + 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 index 8abbbd9..1881067 100644 --- 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 @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -32,9 +33,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: +) -> Any | ServiceUnavailableError | None: if response.status_code == 204: - return None + response_204 = cast(Any, None) + return response_204 + + 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) @@ -44,7 +51,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +65,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any]: +) -> Response[Any | ServiceUnavailableError]: """Mark All Read Mark all model lifecycle alerts as read for the account. @@ -75,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -90,12 +97,44 @@ def sync_detailed( return _build_response(client=client, response=response) +def sync( + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Any | ServiceUnavailableError | None: + """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: + Any | ServiceUnavailableError + """ + + 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[Any]: +) -> Response[Any | ServiceUnavailableError]: """Mark All Read Mark all model lifecycle alerts as read for the account. @@ -112,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,3 +162,37 @@ async def asyncio_detailed( 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, +) -> Any | ServiceUnavailableError | None: + """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: + Any | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed 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 index 3682eeb..a53eb6b 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Mark Read Mark a single model lifecycle alert as read (dismissed). @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Mark Read Mark a single model lifecycle alert as read (dismissed). @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Mark Read Mark a single model lifecycle alert as read (dismissed). @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Mark Read Mark a single model lifecycle alert as read (dismissed). @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index b2f6e77..f6a177a 100644 --- a/seclai/_generated/api/search/docs_search_api_docs_search_get.py +++ b/seclai/_generated/api/search/docs_search_api_docs_search_get.py @@ -11,6 +11,7 @@ ) from ...models.docs_search_response import DocsSearchResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -57,7 +58,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DocsSearchResponse | HTTPValidationError | None: +) -> DocsSearchResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = DocsSearchResponse.from_dict(response.json()) @@ -68,6 +69,11 @@ def _parse_response( 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: @@ -76,7 +82,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DocsSearchResponse | HTTPValidationError]: +) -> Response[DocsSearchResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -95,7 +101,7 @@ def sync_detailed( limit: int | Unset = 8, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[DocsSearchResponse | HTTPValidationError]: +) -> Response[DocsSearchResponse | HTTPValidationError | ServiceUnavailableError]: """Search documentation Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page @@ -118,7 +124,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DocsSearchResponse | HTTPValidationError] + Response[DocsSearchResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -146,7 +152,7 @@ def sync( limit: int | Unset = 8, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> DocsSearchResponse | HTTPValidationError | None: +) -> DocsSearchResponse | HTTPValidationError | ServiceUnavailableError | None: """Search documentation Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page @@ -169,7 +175,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DocsSearchResponse | HTTPValidationError + DocsSearchResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -192,7 +198,7 @@ async def asyncio_detailed( limit: int | Unset = 8, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[DocsSearchResponse | HTTPValidationError]: +) -> Response[DocsSearchResponse | HTTPValidationError | ServiceUnavailableError]: """Search documentation Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page @@ -215,7 +221,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DocsSearchResponse | HTTPValidationError] + Response[DocsSearchResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -241,7 +247,7 @@ async def asyncio( limit: int | Unset = 8, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> DocsSearchResponse | HTTPValidationError | None: +) -> DocsSearchResponse | HTTPValidationError | ServiceUnavailableError | None: """Search documentation Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page @@ -264,7 +270,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DocsSearchResponse | HTTPValidationError + DocsSearchResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/search/search_api_search_get.py b/seclai/_generated/api/search/search_api_search_get.py index 751dd09..6a1443c 100644 --- a/seclai/_generated/api/search/search_api_search_get.py +++ b/seclai/_generated/api/search/search_api_search_get.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.search_response import SearchResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -53,7 +54,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SearchResponse | None: +) -> HTTPValidationError | SearchResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = SearchResponse.from_dict(response.json()) @@ -64,6 +65,11 @@ def _parse_response( 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: @@ -72,7 +78,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SearchResponse]: +) -> Response[HTTPValidationError | SearchResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,7 +95,7 @@ def sync_detailed( entity_type: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SearchResponse]: +) -> Response[HTTPValidationError | SearchResponse | ServiceUnavailableError]: """Search resources Search across all resource types in your account. Accepts a free-text keyword query or a UUID. @@ -111,7 +117,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SearchResponse] + Response[HTTPValidationError | SearchResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -137,7 +143,7 @@ def sync( entity_type: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SearchResponse | None: +) -> HTTPValidationError | SearchResponse | ServiceUnavailableError | None: """Search resources Search across all resource types in your account. Accepts a free-text keyword query or a UUID. @@ -159,7 +165,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SearchResponse + HTTPValidationError | SearchResponse | ServiceUnavailableError """ return sync_detailed( @@ -180,7 +186,7 @@ async def asyncio_detailed( entity_type: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SearchResponse]: +) -> Response[HTTPValidationError | SearchResponse | ServiceUnavailableError]: """Search resources Search across all resource types in your account. Accepts a free-text keyword query or a UUID. @@ -202,7 +208,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SearchResponse] + Response[HTTPValidationError | SearchResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -226,7 +232,7 @@ async def asyncio( entity_type: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SearchResponse | None: +) -> HTTPValidationError | SearchResponse | ServiceUnavailableError | None: """Search resources Search across all resource types in your account. Accepts a free-text keyword query or a UUID. @@ -248,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SearchResponse + HTTPValidationError | SearchResponse | ServiceUnavailableError """ return ( 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 index cf9f4a0..6e46931 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.add_conversation_turn_request import AddConversationTurnRequest from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_conversation_response import SolutionConversationResponse from ...types import UNSET, Response, Unset @@ -44,7 +45,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionConversationResponse | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse | None +): if response.status_code == 201: response_201 = SolutionConversationResponse.from_dict(response.json()) @@ -55,6 +58,11 @@ def _parse_response( 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: @@ -63,7 +71,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionConversationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +89,9 @@ def sync_detailed( body: AddConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionConversationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse +]: """Add conversation turn Add a conversation turn to a solution's AI assistant history. @@ -98,7 +110,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionConversationResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse] """ kwargs = _get_kwargs( @@ -122,7 +134,9 @@ def sync( body: AddConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionConversationResponse | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse | None +): """Add conversation turn Add a conversation turn to a solution's AI assistant history. @@ -141,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionConversationResponse + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse """ return sync_detailed( @@ -160,7 +174,9 @@ async def asyncio_detailed( body: AddConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionConversationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse +]: """Add conversation turn Add a conversation turn to a solution's AI assistant history. @@ -179,7 +195,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionConversationResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse] """ kwargs = _get_kwargs( @@ -201,7 +217,9 @@ async def asyncio( body: AddConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionConversationResponse | None: +) -> ( + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse | None +): """Add conversation turn Add a conversation turn to a solution's AI assistant history. @@ -220,7 +238,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionConversationResponse + HTTPValidationError | ServiceUnavailableError | SolutionConversationResponse """ return ( 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 index ba50d36..e9f83c0 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.ai_assistant_accept_request import AiAssistantAcceptRequest from ...models.ai_assistant_accept_response import AiAssistantAcceptResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -46,7 +47,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantAcceptResponse.from_dict(response.json()) @@ -57,6 +58,11 @@ def _parse_response( 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: @@ -65,7 +71,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,9 @@ def sync_detailed( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept plan Accept and execute a proposed plan generated by one of the AI assistant endpoints. @@ -103,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantAcceptResponse | HTTPValidationError] + Response[AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -129,7 +139,7 @@ def sync( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: """Accept plan Accept and execute a proposed plan generated by one of the AI assistant endpoints. @@ -150,7 +160,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantAcceptResponse | HTTPValidationError + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -171,7 +181,9 @@ async def asyncio_detailed( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: +) -> Response[ + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError +]: """Accept plan Accept and execute a proposed plan generated by one of the AI assistant endpoints. @@ -192,7 +204,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantAcceptResponse | HTTPValidationError] + Response[AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -216,7 +228,7 @@ async def asyncio( body: AiAssistantAcceptRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: +) -> AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError | None: """Accept plan Accept and execute a proposed plan generated by one of the AI assistant endpoints. @@ -237,7 +249,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantAcceptResponse | HTTPValidationError + AiAssistantAcceptResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index b2ce507..64b7bd8 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -39,7 +40,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,7 +79,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline plan Decline a proposed plan generated by one of the AI assistant endpoints. @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline plan Decline a proposed plan generated by one of the AI assistant endpoints. @@ -135,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -154,7 +160,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Decline plan Decline a proposed plan generated by one of the AI assistant endpoints. @@ -173,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -195,7 +201,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Decline plan Decline a proposed plan generated by one of the AI assistant endpoints. @@ -214,7 +220,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 1e6b98a..cea88db 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate solution plan Generate a comprehensive solution management plan via the solution AI assistant. @@ -101,7 +111,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -125,7 +135,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate solution plan Generate a comprehensive solution management plan via the solution AI assistant. @@ -147,7 +157,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -166,7 +176,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate solution plan Generate a comprehensive solution management plan via the solution AI assistant. @@ -188,7 +200,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -210,7 +222,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate solution plan Generate a comprehensive solution management plan via the solution AI assistant. @@ -232,7 +244,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 4bea15f..26e86d9 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate knowledge base plan Generate a knowledge base plan via the KB AI assistant. @@ -99,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +133,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate knowledge base plan Generate a knowledge base plan via the KB AI assistant. @@ -143,7 +153,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +172,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate knowledge base plan Generate a knowledge base plan via the KB AI assistant. @@ -182,7 +194,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +216,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate knowledge base plan Generate a knowledge base plan via the KB AI assistant. @@ -224,7 +236,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index ed6201d..84f6da6 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = AiAssistantGenerateResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,9 @@ def sync_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate source plan Generate a content source plan via the source AI assistant. @@ -99,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -123,7 +133,7 @@ def sync( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate source plan Generate a content source plan via the source AI assistant. @@ -143,7 +153,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -162,7 +172,9 @@ async def asyncio_detailed( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: +) -> Response[ + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError +]: """Generate source plan Generate a content source plan via the source AI assistant. @@ -182,7 +194,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiAssistantGenerateResponse | HTTPValidationError] + Response[AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -204,7 +216,7 @@ async def asyncio( body: AiAssistantGenerateRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: +) -> AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError | None: """Generate source plan Generate a content source plan via the source AI assistant. @@ -224,7 +236,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiAssistantGenerateResponse | HTTPValidationError + AiAssistantGenerateResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/api/solutions/create_solution_api_solutions_post.py b/seclai/_generated/api/solutions/create_solution_api_solutions_post.py index cd7a18d..fd0bf24 100644 --- a/seclai/_generated/api/solutions/create_solution_api_solutions_post.py +++ b/seclai/_generated/api/solutions/create_solution_api_solutions_post.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.create_solution_request import CreateSolutionRequest from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 201: response_201 = SolutionResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: CreateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Create a solution Create a new solution for the caller's account. @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -114,7 +120,7 @@ def sync( body: CreateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Create a solution Create a new solution for the caller's account. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( body: CreateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Create a solution Create a new solution for the caller's account. @@ -167,7 +173,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -187,7 +193,7 @@ async def asyncio( body: CreateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Create a solution Create a new solution for the caller's account. @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index d5142a9..1c366af 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete a solution Delete a solution by its ID. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete a solution Delete a solution by its ID. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete a solution Delete a solution by its ID. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete a solution Delete a solution by its ID. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index ae5c7f1..c727545 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Get a solution Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. @@ -89,7 +95,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -111,7 +117,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Get a solution Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Get a solution Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. @@ -162,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -182,7 +188,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Get a solution Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. @@ -199,7 +205,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 6bc5316..de0280d 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.link_resources_request import LinkResourcesRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link agents Link one or more agents to a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link agents Link one or more agents to a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link agents Link one or more agents to a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link agents Link one or more agents to a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 2a21e45..c308651 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.link_resources_request import LinkResourcesRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link knowledge bases Link one or more knowledge bases to a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link knowledge bases Link one or more knowledge bases to a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link knowledge bases Link one or more knowledge bases to a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link knowledge bases Link one or more knowledge bases to a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 469dc2c..9662ba3 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.link_resources_request import LinkResourcesRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link source connections Link one or more source connections to a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link source connections Link one or more source connections to a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Link source connections Link one or more source connections to a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: LinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Link source connections Link one or more source connections to a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 113c752..25e419f 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_conversation_response import SolutionConversationResponse from ...types import UNSET, Response, Unset @@ -38,7 +39,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[SolutionConversationResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[SolutionConversationResponse] + | None +): if response.status_code == 200: response_200 = [] _response_200 = response.json() @@ -56,6 +62,11 @@ def _parse_response( 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: @@ -64,7 +75,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +92,9 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse] +]: """List conversations List AI assistant conversation history for a solution. @@ -97,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[SolutionConversationResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse]] """ kwargs = _get_kwargs( @@ -119,7 +134,12 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[SolutionConversationResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[SolutionConversationResponse] + | None +): """List conversations List AI assistant conversation history for a solution. @@ -137,7 +157,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[SolutionConversationResponse] + HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse] """ return sync_detailed( @@ -154,7 +174,9 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse] +]: """List conversations List AI assistant conversation history for a solution. @@ -172,7 +194,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | list[SolutionConversationResponse]] + Response[HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse]] """ kwargs = _get_kwargs( @@ -192,7 +214,12 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[SolutionConversationResponse] | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | list[SolutionConversationResponse] + | None +): """List conversations List AI assistant conversation history for a solution. @@ -210,7 +237,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | list[SolutionConversationResponse] + HTTPValidationError | ServiceUnavailableError | list[SolutionConversationResponse] """ return ( diff --git a/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py b/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py index da2730f..f392631 100644 --- a/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py +++ b/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_list_response import SolutionListResponse from ...types import UNSET, Response, Unset @@ -59,7 +60,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionListResponse | None: if response.status_code == 200: response_200 = SolutionListResponse.from_dict(response.json()) @@ -70,6 +71,11 @@ def _parse_response( 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: @@ -78,7 +84,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +103,7 @@ def sync_detailed( search: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionListResponse]: """List solutions List solutions for your account. @@ -127,7 +133,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionListResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionListResponse] """ kwargs = _get_kwargs( @@ -157,7 +163,7 @@ def sync( search: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionListResponse | None: """List solutions List solutions for your account. @@ -187,7 +193,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionListResponse + HTTPValidationError | ServiceUnavailableError | SolutionListResponse """ return sync_detailed( @@ -212,7 +218,7 @@ async def asyncio_detailed( search: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionListResponse]: """List solutions List solutions for your account. @@ -242,7 +248,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionListResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionListResponse] """ kwargs = _get_kwargs( @@ -270,7 +276,7 @@ async def asyncio( search: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionListResponse | None: """List solutions List solutions for your account. @@ -300,7 +306,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionListResponse + HTTPValidationError | ServiceUnavailableError | SolutionListResponse """ return ( 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 index 36c5d6c..bc66f53 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.mark_conversation_turn_request import MarkConversationTurnRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -45,7 +46,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +86,7 @@ def sync_detailed( body: MarkConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Mark conversation turn Mark a conversation turn as accepted or declined. @@ -100,7 +106,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -126,7 +132,7 @@ def sync( body: MarkConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Mark conversation turn Mark a conversation turn as accepted or declined. @@ -146,7 +152,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -167,7 +173,7 @@ async def asyncio_detailed( body: MarkConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Mark conversation turn Mark a conversation turn as accepted or declined. @@ -187,7 +193,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -211,7 +217,7 @@ async def asyncio( body: MarkConversationTurnRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Mark conversation turn Mark a conversation turn as accepted or declined. @@ -231,7 +237,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 39c4757..a9095e3 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...models.unlink_resources_request import UnlinkResourcesRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink agents Unlink one or more agents from a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink agents Unlink one or more agents from a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink agents Unlink one or more agents from a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink agents Unlink one or more agents from a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 00b5690..1f19ffc 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...models.unlink_resources_request import UnlinkResourcesRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink knowledge bases Unlink one or more knowledge bases from a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink knowledge bases Unlink one or more knowledge bases from a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink knowledge bases Unlink one or more knowledge bases from a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink knowledge bases Unlink one or more knowledge bases from a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index da920c1..4d5ac2e 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...models.unlink_resources_request import UnlinkResourcesRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink source connections Unlink one or more source connections from a solution by their IDs. @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink source connections Unlink one or more source connections from a solution by their IDs. @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Unlink source connections Unlink one or more source connections from a solution by their IDs. @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: UnlinkResourcesRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Unlink source connections Unlink one or more source connections from a solution by their IDs. @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index 3d7f917..4904212 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.solution_response import SolutionResponse from ...models.update_solution_request import UpdateSolutionRequest from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: if response.status_code == 200: response_200 = SolutionResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Update a solution Update an existing solution's name or description. @@ -97,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -121,7 +127,7 @@ def sync( body: UpdateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Update a solution Update an existing solution's name or description. @@ -139,7 +145,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return sync_detailed( @@ -158,7 +164,7 @@ async def asyncio_detailed( body: UpdateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse]: """Update a solution Update an existing solution's name or description. @@ -176,7 +182,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SolutionResponse] + Response[HTTPValidationError | ServiceUnavailableError | SolutionResponse] """ kwargs = _get_kwargs( @@ -198,7 +204,7 @@ async def asyncio( body: UpdateSolutionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SolutionResponse | None: """Update a solution Update an existing solution's name or description. @@ -216,7 +222,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SolutionResponse + HTTPValidationError | ServiceUnavailableError | SolutionResponse """ return ( 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 index c5d82e7..35499d7 100644 --- 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.export_response import ExportResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,17 +41,26 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ExportResponse.from_dict(response.json()) 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 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: @@ -59,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,11 +85,13 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: """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. + Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization + account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused + with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -92,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,11 +128,13 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | 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. + Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization + account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused + with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -133,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + Any | ExportResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -152,11 +166,13 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: """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. + Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization + account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused + with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -169,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,11 +207,13 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | 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. + Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization + account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused + with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -208,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + Any | ExportResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 09899b1..45929f5 100644 --- 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -10,6 +10,7 @@ from ...models.create_export_request import CreateExportRequest from ...models.export_response import ExportResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,17 +45,26 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 202: response_202 = ExportResponse.from_dict(response.json()) return response_202 + 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: @@ -63,7 +73,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,11 +89,13 @@ def sync_detailed( body: CreateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: """Create export Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. + then use /download to retrieve the file. On an organization account, a key bound to a user must + belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. + Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -96,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -120,11 +132,13 @@ def sync( body: CreateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Create export Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. + then use /download to retrieve the file. On an organization account, a key bound to a user must + belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. + Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -137,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + Any | ExportResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -156,11 +170,13 @@ async def asyncio_detailed( body: CreateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError]: """Create export Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. + then use /download to retrieve the file. On an organization account, a key bound to a user must + belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. + Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -173,7 +189,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[Any | ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -195,11 +211,13 @@ async def asyncio( body: CreateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> Any | ExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Create export Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. + then use /download to retrieve the file. On an organization account, a key bound to a user must + belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. + Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -212,7 +230,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + Any | ExportResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 352099a..eb740de 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -39,16 +40,25 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 + 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: @@ -57,7 +67,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,11 +83,13 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """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. + record is retained for audit purposes but the backing file is permanently removed. On an + organization account, a key bound to a user must belong to an owner or administrator; a viewer's key + is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -90,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,11 +126,13 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | 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. + record is retained for audit purposes but the backing file is permanently removed. On an + organization account, a key bound to a user must belong to an owner or administrator; a viewer's key + is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -131,7 +145,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -150,11 +164,13 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """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. + record is retained for audit purposes but the backing file is permanently removed. On an + organization account, a key bound to a user must belong to an owner or administrator; a viewer's key + is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -167,7 +183,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -189,11 +205,13 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | 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. + record is retained for audit purposes but the backing file is permanently removed. On an + organization account, a key bound to a user must belong to an owner or administrator; a viewer's key + is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. Args: source_connection_id (UUID): @@ -206,7 +224,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 25b8df9..7891626 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -39,7 +40,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = response.json() return response_200 @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,7 +79,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Download export Stream the completed export file. Returns the file content with appropriate Content-Type and @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -115,7 +121,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Download export Stream the completed export file. Returns the file content with appropriate Content-Type and @@ -133,7 +139,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -152,7 +158,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Download export Stream the completed export file. Returns the file content with appropriate Content-Type and @@ -170,7 +176,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -192,7 +198,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Download export Stream the completed export file. Returns the file content with appropriate Content-Type and @@ -210,7 +216,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 112d656..e118b30 100644 --- 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 @@ -10,6 +10,7 @@ from ...models.estimate_export_request import EstimateExportRequest from ...models.estimate_export_response import EstimateExportResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EstimateExportResponse | HTTPValidationError | None: +) -> EstimateExportResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = EstimateExportResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EstimateExportResponse | HTTPValidationError]: +) -> Response[EstimateExportResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: EstimateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EstimateExportResponse | HTTPValidationError]: +) -> Response[EstimateExportResponse | HTTPValidationError | ServiceUnavailableError]: """Estimate export size Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use @@ -96,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EstimateExportResponse | HTTPValidationError] + Response[EstimateExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -120,7 +126,7 @@ def sync( body: EstimateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EstimateExportResponse | HTTPValidationError | None: +) -> EstimateExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Estimate export size Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use @@ -137,7 +143,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EstimateExportResponse | HTTPValidationError + EstimateExportResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -156,7 +162,7 @@ async def asyncio_detailed( body: EstimateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[EstimateExportResponse | HTTPValidationError]: +) -> Response[EstimateExportResponse | HTTPValidationError | ServiceUnavailableError]: """Estimate export size Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use @@ -173,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EstimateExportResponse | HTTPValidationError] + Response[EstimateExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -195,7 +201,7 @@ async def asyncio( body: EstimateExportRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> EstimateExportResponse | HTTPValidationError | None: +) -> EstimateExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Estimate export size Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use @@ -212,7 +218,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EstimateExportResponse | HTTPValidationError + EstimateExportResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index d1f1b2f..6fe1c8d 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.export_response import ExportResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: +) -> ExportResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ExportResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[ExportResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,7 +81,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[ExportResponse | HTTPValidationError | ServiceUnavailableError]: """Get export status Retrieve the current status and progress of an export job. Returns all metadata including progress @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -116,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> ExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Get export status Retrieve the current status and progress of an export job. Returns all metadata including progress @@ -133,7 +139,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + ExportResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -152,7 +158,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: +) -> Response[ExportResponse | HTTPValidationError | ServiceUnavailableError]: """Get export status Retrieve the current status and progress of an export job. Returns all metadata including progress @@ -169,7 +175,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportResponse | HTTPValidationError] + Response[ExportResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -191,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: +) -> ExportResponse | HTTPValidationError | ServiceUnavailableError | None: """Get export status Retrieve the current status and progress of an export job. Returns all metadata including progress @@ -208,7 +214,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportResponse | HTTPValidationError + ExportResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 76434e6..50a333e 100644 --- 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 @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.export_list_response import ExportListResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -49,7 +50,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportListResponse | HTTPValidationError | None: +) -> ExportListResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ExportListResponse.from_dict(response.json()) @@ -60,6 +61,11 @@ def _parse_response( 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: @@ -68,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportListResponse | HTTPValidationError]: +) -> Response[ExportListResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +91,7 @@ def sync_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportListResponse | HTTPValidationError]: +) -> Response[ExportListResponse | HTTPValidationError | ServiceUnavailableError]: """List exports List all export jobs for a source connection, ordered newest first. Supports pagination via @@ -104,7 +110,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportListResponse | HTTPValidationError] + Response[ExportListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -130,7 +136,7 @@ def sync( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportListResponse | HTTPValidationError | None: +) -> ExportListResponse | HTTPValidationError | ServiceUnavailableError | None: """List exports List all export jobs for a source connection, ordered newest first. Supports pagination via @@ -149,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportListResponse | HTTPValidationError + ExportListResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -170,7 +176,7 @@ async def asyncio_detailed( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ExportListResponse | HTTPValidationError]: +) -> Response[ExportListResponse | HTTPValidationError | ServiceUnavailableError]: """List exports List all export jobs for a source connection, ordered newest first. Supports pagination via @@ -189,7 +195,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportListResponse | HTTPValidationError] + Response[ExportListResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -213,7 +219,7 @@ async def asyncio( limit: int | Unset = 20, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ExportListResponse | HTTPValidationError | None: +) -> ExportListResponse | HTTPValidationError | ServiceUnavailableError | None: """List exports List all export jobs for a source connection, ordered newest first. Supports pagination via @@ -232,7 +238,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportListResponse | HTTPValidationError + ExportListResponse | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 7610c7f..a80a0e8 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_embedding_migration_response import ( SourceEmbeddingMigrationResponse, ) @@ -40,7 +41,12 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse + | None +): if response.status_code == 200: response_200 = SourceEmbeddingMigrationResponse.from_dict(response.json()) @@ -51,6 +57,11 @@ def _parse_response( 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: @@ -59,7 +70,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,12 +87,16 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse +]: """Cancel Source Embedding Migration Cancel an active embedding migration for a custom-index source. - Only pending, running, or switching migrations can be cancelled. + Only pending and running migrations can be cancelled. A migration that has reached the switching + phase is committing its switch-over in a single transaction, so there is no half-applied state to + back out of and cancel is refused. Args: source_connection_id (UUID): @@ -91,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceEmbeddingMigrationResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse] """ kwargs = _get_kwargs( @@ -113,12 +130,19 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | 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. + Only pending and running migrations can be cancelled. A migration that has reached the switching + phase is committing its switch-over in a single transaction, so there is no half-applied state to + back out of and cancel is refused. Args: source_connection_id (UUID): @@ -130,7 +154,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceEmbeddingMigrationResponse + HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse """ return sync_detailed( @@ -147,12 +171,16 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse +]: """Cancel Source Embedding Migration Cancel an active embedding migration for a custom-index source. - Only pending, running, or switching migrations can be cancelled. + Only pending and running migrations can be cancelled. A migration that has reached the switching + phase is committing its switch-over in a single transaction, so there is no half-applied state to + back out of and cancel is refused. Args: source_connection_id (UUID): @@ -164,7 +192,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceEmbeddingMigrationResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse] """ kwargs = _get_kwargs( @@ -184,12 +212,19 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | ServiceUnavailableError + | 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. + Only pending and running migrations can be cancelled. A migration that has reached the switching + phase is committing its switch-over in a single transaction, so there is no half-applied state to + back out of and cancel is refused. Args: source_connection_id (UUID): @@ -201,7 +236,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceEmbeddingMigrationResponse + HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse """ return ( 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 0b6b70d..79a6cd6 100644 --- a/seclai/_generated/api/sources/create_source_api_sources_post.py +++ b/seclai/_generated/api/sources/create_source_api_sources_post.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.create_source_body import CreateSourceBody from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_response import SourceResponse from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | SourceResponse | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | SourceResponse | None: if response.status_code == 201: response_201 = SourceResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | SourceResponse]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError | SourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,7 +84,7 @@ def sync_detailed( body: CreateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceResponse]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Create Source Create a new content source. @@ -102,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | SourceResponse] + Response[Any | HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -124,7 +130,7 @@ def sync( body: CreateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceResponse | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Create Source Create a new content source. @@ -148,7 +154,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | SourceResponse + Any | HTTPValidationError | ServiceUnavailableError | SourceResponse """ return sync_detailed( @@ -165,7 +171,7 @@ async def asyncio_detailed( body: CreateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceResponse]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Create Source Create a new content source. @@ -189,7 +195,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | SourceResponse] + Response[Any | HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -209,7 +215,7 @@ async def asyncio( body: CreateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceResponse | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Create Source Create a new content source. @@ -233,7 +239,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | SourceResponse + Any | HTTPValidationError | ServiceUnavailableError | SourceResponse """ return ( 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 index f75100e..dea7354 100644 --- 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 @@ -8,6 +8,7 @@ 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, Response, Unset @@ -37,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -47,6 +48,11 @@ def _parse_response( 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: @@ -55,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +76,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Source Soft-delete a content source. This action cannot be undone. @@ -88,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -110,7 +116,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Source Soft-delete a content source. This action cannot be undone. @@ -128,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Delete Source Soft-delete a content source. This action cannot be undone. @@ -163,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Delete Source Soft-delete a content source. This action cannot be undone. @@ -201,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index fd5ff4d..64af5c5 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_response import SourceResponse from ...types import UNSET, Response, Unset @@ -38,7 +39,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: if response.status_code == 200: response_200 = SourceResponse.from_dict(response.json()) @@ -49,6 +50,11 @@ def _parse_response( 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: @@ -57,7 +63,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,7 +78,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Get Source Fetch a content source by ID. @@ -91,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Get Source Fetch a content source by ID. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceResponse + HTTPValidationError | ServiceUnavailableError | SourceResponse """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Get Source Fetch a content source by ID. @@ -168,7 +174,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -188,7 +194,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Get Source Fetch a content source by ID. @@ -207,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceResponse + HTTPValidationError | ServiceUnavailableError | SourceResponse """ return ( 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 new file mode 100644 index 0000000..6748cc4 --- /dev/null +++ b/seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py @@ -0,0 +1,266 @@ +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.service_unavailable_error import ServiceUnavailableError +from ...models.source_content_status_response import SourceContentStatusResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_id: UUID, + content_version_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}/contents/{content_version_id}".format( + source_connection_id=quote(str(source_connection_id), safe=""), + content_version_id=quote(str(content_version_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse | None: + if response.status_code == 200: + response_200 = SourceContentStatusResponse.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[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse +]: + 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, + content_version_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse +]: + """Get one content item's indexing status + + Get the indexing status of a single content item, addressed by the `content_version_id` the upload + endpoints return. + + Use 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. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your + account. + + Args: + source_connection_id (UUID): + content_version_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 | ServiceUnavailableError | SourceContentStatusResponse] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + content_version_id=content_version_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, + content_version_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse | None: + """Get one content item's indexing status + + Get the indexing status of a single content item, addressed by the `content_version_id` the upload + endpoints return. + + Use 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. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your + account. + + Args: + source_connection_id (UUID): + content_version_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 | ServiceUnavailableError | SourceContentStatusResponse + """ + + return sync_detailed( + source_connection_id=source_connection_id, + content_version_id=content_version_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_id: UUID, + content_version_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse +]: + """Get one content item's indexing status + + Get the indexing status of a single content item, addressed by the `content_version_id` the upload + endpoints return. + + Use 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. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your + account. + + Args: + source_connection_id (UUID): + content_version_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 | ServiceUnavailableError | SourceContentStatusResponse] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + content_version_id=content_version_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, + content_version_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> HTTPValidationError | ServiceUnavailableError | SourceContentStatusResponse | None: + """Get one content item's indexing status + + Get the indexing status of a single content item, addressed by the `content_version_id` the upload + endpoints return. + + Use 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. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your + account. + + Args: + source_connection_id (UUID): + content_version_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 | ServiceUnavailableError | SourceContentStatusResponse + """ + + return ( + await asyncio_detailed( + source_connection_id=source_connection_id, + content_version_id=content_version_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 index 49c14e7..7ef1d2a 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_embedding_migration_response import ( SourceEmbeddingMigrationResponse, ) @@ -40,7 +41,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError + | None +): if response.status_code == 200: def _parse_response_200( @@ -67,6 +74,11 @@ def _parse_response_200( 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: @@ -75,7 +87,12 @@ def _parse_response_200( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,7 +107,12 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError +]: """Get Source Embedding Migration Get the latest embedding migration status for a custom-index source. @@ -107,7 +129,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse] + Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -129,7 +151,13 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError + | None +): """Get Source Embedding Migration Get the latest embedding migration status for a custom-index source. @@ -146,7 +174,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | None | SourceEmbeddingMigrationResponse + HTTPValidationError | None | SourceEmbeddingMigrationResponse | ServiceUnavailableError """ return sync_detailed( @@ -163,7 +191,12 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: +) -> Response[ + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError +]: """Get Source Embedding Migration Get the latest embedding migration status for a custom-index source. @@ -180,7 +213,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse] + Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -200,7 +233,13 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: +) -> ( + HTTPValidationError + | None + | SourceEmbeddingMigrationResponse + | ServiceUnavailableError + | None +): """Get Source Embedding Migration Get the latest embedding migration status for a custom-index source. @@ -217,7 +256,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | None | SourceEmbeddingMigrationResponse + HTTPValidationError | None | SourceEmbeddingMigrationResponse | ServiceUnavailableError """ return ( 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 new file mode 100644 index 0000000..b2d41a4 --- /dev/null +++ b/seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py @@ -0,0 +1,452 @@ +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.service_unavailable_error import ServiceUnavailableError +from ...models.source_content_status_list_response import ( + SourceContentStatusListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_id: UUID, + *, + page: int | Unset = 1, + limit: int | Unset = 20, + sort: str | Unset = "created_at", + order: str | Unset = "desc", + status: None | str | Unset = UNSET, + content_version_id: list[UUID] | 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 + + params["sort"] = sort + + params["order"] = order + + json_status: None | str | Unset + if isinstance(status, Unset): + json_status = UNSET + else: + json_status = status + params["status"] = json_status + + json_content_version_id: list[str] | None | Unset + if isinstance(content_version_id, Unset): + json_content_version_id = UNSET + elif isinstance(content_version_id, list): + json_content_version_id = [] + for content_version_id_type_0_item_data in content_version_id: + content_version_id_type_0_item = str(content_version_id_type_0_item_data) + json_content_version_id.append(content_version_id_type_0_item) + + else: + json_content_version_id = content_version_id + params["content_version_id"] = json_content_version_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/{source_connection_id}/contents".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 +) -> ( + HTTPValidationError + | ServiceUnavailableError + | SourceContentStatusListResponse + | None +): + if response.status_code == 200: + response_200 = SourceContentStatusListResponse.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[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusListResponse +]: + 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, + sort: str | Unset = "created_at", + order: str | Unset = "desc", + status: None | str | Unset = UNSET, + content_version_id: list[UUID] | None | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusListResponse +]: + """List content items and their indexing status + + List every content item this source has attempted to index, with the status of each. + + Unlike the source's `content_count`, which only counts finished items, this listing includes items + that are still processing and items that failed — so a bulk upload can report per-item progress and + point at the specific items that did not make it. + + Correlating with an upload: + - 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. + - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is + 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`. + + Parameters: + - Pagination: `page` and `limit`. + - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the + item was uploaded or pulled. + - Filtering: `status` and repeatable `content_version_id`. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging + to your account. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number Default: 1. + limit (int | Unset): Items per page Default: 20. + sort (str | Unset): Sort field (created_at/title/status) Default: 'created_at'. + order (str | Unset): Sort order Default: 'desc'. + status (None | str | Unset): Filter to one status: pending, fetching, transcribing, + scanning, indexing, completed, or failed. Use `failed` to list only the items that could + not be indexed. + content_version_id (list[UUID] | None | Unset): Filter to specific content versions, + repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll + exactly the items you uploaded in a single request. At most 500 ids per request — beyond + that, page through the unfiltered listing or split the poll. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ServiceUnavailableError | SourceContentStatusListResponse] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + page=page, + limit=limit, + sort=sort, + order=order, + status=status, + content_version_id=content_version_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, + page: int | Unset = 1, + limit: int | Unset = 20, + sort: str | Unset = "created_at", + order: str | Unset = "desc", + status: None | str | Unset = UNSET, + content_version_id: list[UUID] | None | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | SourceContentStatusListResponse + | None +): + """List content items and their indexing status + + List every content item this source has attempted to index, with the status of each. + + Unlike the source's `content_count`, which only counts finished items, this listing includes items + that are still processing and items that failed — so a bulk upload can report per-item progress and + point at the specific items that did not make it. + + Correlating with an upload: + - 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. + - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is + 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`. + + Parameters: + - Pagination: `page` and `limit`. + - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the + item was uploaded or pulled. + - Filtering: `status` and repeatable `content_version_id`. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging + to your account. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number Default: 1. + limit (int | Unset): Items per page Default: 20. + sort (str | Unset): Sort field (created_at/title/status) Default: 'created_at'. + order (str | Unset): Sort order Default: 'desc'. + status (None | str | Unset): Filter to one status: pending, fetching, transcribing, + scanning, indexing, completed, or failed. Use `failed` to list only the items that could + not be indexed. + content_version_id (list[UUID] | None | Unset): Filter to specific content versions, + repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll + exactly the items you uploaded in a single request. At most 500 ids per request — beyond + that, page through the unfiltered listing or split the poll. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server 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 | ServiceUnavailableError | SourceContentStatusListResponse + """ + + return sync_detailed( + source_connection_id=source_connection_id, + client=client, + page=page, + limit=limit, + sort=sort, + order=order, + status=status, + content_version_id=content_version_id, + 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, + sort: str | Unset = "created_at", + order: str | Unset = "desc", + status: None | str | Unset = UNSET, + content_version_id: list[UUID] | None | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + HTTPValidationError | ServiceUnavailableError | SourceContentStatusListResponse +]: + """List content items and their indexing status + + List every content item this source has attempted to index, with the status of each. + + Unlike the source's `content_count`, which only counts finished items, this listing includes items + that are still processing and items that failed — so a bulk upload can report per-item progress and + point at the specific items that did not make it. + + Correlating with an upload: + - 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. + - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is + 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`. + + Parameters: + - Pagination: `page` and `limit`. + - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the + item was uploaded or pulled. + - Filtering: `status` and repeatable `content_version_id`. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging + to your account. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number Default: 1. + limit (int | Unset): Items per page Default: 20. + sort (str | Unset): Sort field (created_at/title/status) Default: 'created_at'. + order (str | Unset): Sort order Default: 'desc'. + status (None | str | Unset): Filter to one status: pending, fetching, transcribing, + scanning, indexing, completed, or failed. Use `failed` to list only the items that could + not be indexed. + content_version_id (list[UUID] | None | Unset): Filter to specific content versions, + repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll + exactly the items you uploaded in a single request. At most 500 ids per request — beyond + that, page through the unfiltered listing or split the poll. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ServiceUnavailableError | SourceContentStatusListResponse] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + page=page, + limit=limit, + sort=sort, + order=order, + status=status, + content_version_id=content_version_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, + page: int | Unset = 1, + limit: int | Unset = 20, + sort: str | Unset = "created_at", + order: str | Unset = "desc", + status: None | str | Unset = UNSET, + content_version_id: list[UUID] | None | Unset = UNSET, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + HTTPValidationError + | ServiceUnavailableError + | SourceContentStatusListResponse + | None +): + """List content items and their indexing status + + List every content item this source has attempted to index, with the status of each. + + Unlike the source's `content_count`, which only counts finished items, this listing includes items + that are still processing and items that failed — so a bulk upload can report per-item progress and + point at the specific items that did not make it. + + Correlating with an upload: + - 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. + - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is + 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`. + + Parameters: + - Pagination: `page` and `limit`. + - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the + item was uploaded or pulled. + - Filtering: `status` and repeatable `content_version_id`. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging + to your account. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number Default: 1. + limit (int | Unset): Items per page Default: 20. + sort (str | Unset): Sort field (created_at/title/status) Default: 'created_at'. + order (str | Unset): Sort order Default: 'desc'. + status (None | str | Unset): Filter to one status: pending, fetching, transcribing, + scanning, indexing, completed, or failed. Use `failed` to list only the items that could + not be indexed. + content_version_id (list[UUID] | None | Unset): Filter to specific content versions, + repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll + exactly the items you uploaded in a single request. At most 500 ids per request — beyond + that, page through the unfiltered listing or split the poll. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server 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 | ServiceUnavailableError | SourceContentStatusListResponse + """ + + return ( + await asyncio_detailed( + source_connection_id=source_connection_id, + client=client, + page=page, + limit=limit, + sort=sort, + order=order, + status=status, + content_version_id=content_version_id, + 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 index 1da1e43..efb72ee 100644 --- a/seclai/_generated/api/sources/list_sources_api_sources_get.py +++ b/seclai/_generated/api/sources/list_sources_api_sources_get.py @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_list_response import SourceListResponse from ...types import UNSET, Response, Unset @@ -59,7 +60,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceListResponse | None: if response.status_code == 200: response_200 = SourceListResponse.from_dict(response.json()) @@ -70,6 +71,11 @@ def _parse_response( 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: @@ -78,7 +84,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +103,7 @@ def sync_detailed( account_id: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceListResponse]: """List sources List content sources for your account. @@ -129,7 +135,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceListResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceListResponse] """ kwargs = _get_kwargs( @@ -159,7 +165,7 @@ def sync( account_id: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceListResponse | None: """List sources List content sources for your account. @@ -191,7 +197,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceListResponse + HTTPValidationError | ServiceUnavailableError | SourceListResponse """ return sync_detailed( @@ -216,7 +222,7 @@ async def asyncio_detailed( account_id: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceListResponse]: """List sources List content sources for your account. @@ -248,7 +254,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceListResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceListResponse] """ kwargs = _get_kwargs( @@ -276,7 +282,7 @@ async def asyncio( account_id: None | str | Unset = UNSET, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceListResponse | None: """List sources List content sources for your account. @@ -308,7 +314,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceListResponse + HTTPValidationError | ServiceUnavailableError | SourceListResponse """ return ( 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 index 8db7841..2ca4794 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_embedding_migration_response import ( SourceEmbeddingMigrationResponse, ) @@ -48,7 +49,13 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse + | None +): if response.status_code == 200: response_200 = SourceEmbeddingMigrationResponse.from_dict(response.json()) @@ -63,6 +70,11 @@ def _parse_response( 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: @@ -71,7 +83,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,7 +104,12 @@ def sync_detailed( body: StartSourceEmbeddingMigrationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse +]: """Start Source Embedding Migration Start an embedding model migration for a custom-index source. @@ -116,7 +138,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse] + Response[Any | HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse] """ kwargs = _get_kwargs( @@ -140,7 +162,13 @@ def sync( body: StartSourceEmbeddingMigrationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse + | None +): """Start Source Embedding Migration Start an embedding model migration for a custom-index source. @@ -169,7 +197,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | SourceEmbeddingMigrationResponse + Any | HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse """ return sync_detailed( @@ -188,7 +216,12 @@ async def asyncio_detailed( body: StartSourceEmbeddingMigrationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: +) -> Response[ + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse +]: """Start Source Embedding Migration Start an embedding model migration for a custom-index source. @@ -217,7 +250,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse] + Response[Any | HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse] """ kwargs = _get_kwargs( @@ -239,7 +272,13 @@ async def asyncio( body: StartSourceEmbeddingMigrationRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: +) -> ( + Any + | HTTPValidationError + | ServiceUnavailableError + | SourceEmbeddingMigrationResponse + | None +): """Start Source Embedding Migration Start an embedding model migration for a custom-index source. @@ -268,7 +307,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | SourceEmbeddingMigrationResponse + Any | HTTPValidationError | ServiceUnavailableError | SourceEmbeddingMigrationResponse """ return ( 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 index ea81c87..24d00ab 100644 --- 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 @@ -8,6 +8,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.source_response import SourceResponse from ...models.update_source_body import UpdateSourceBody from ...types import UNSET, Response, Unset @@ -44,7 +45,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: if response.status_code == 200: response_200 = SourceResponse.from_dict(response.json()) @@ -55,6 +56,11 @@ def _parse_response( 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: @@ -63,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +85,7 @@ def sync_detailed( body: UpdateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Update Source Update a content source's configuration. Only provided fields are changed; omitted fields are left @@ -98,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( body: UpdateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Update Source Update a content source's configuration. Only provided fields are changed; omitted fields are left @@ -141,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceResponse + HTTPValidationError | ServiceUnavailableError | SourceResponse """ return sync_detailed( @@ -160,7 +166,7 @@ async def asyncio_detailed( body: UpdateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: +) -> Response[HTTPValidationError | ServiceUnavailableError | SourceResponse]: """Update Source Update a content source's configuration. Only provided fields are changed; omitted fields are left @@ -179,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | SourceResponse] + Response[HTTPValidationError | ServiceUnavailableError | SourceResponse] """ kwargs = _get_kwargs( @@ -201,7 +207,7 @@ async def asyncio( body: UpdateSourceBody, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: +) -> HTTPValidationError | ServiceUnavailableError | SourceResponse | None: """Update Source Update a content source's configuration. Only provided fields are changed; omitted fields are left @@ -220,7 +226,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | SourceResponse + HTTPValidationError | ServiceUnavailableError | SourceResponse """ return ( 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 4c46455..e818d9b 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -11,6 +11,7 @@ BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, ) from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -43,12 +44,21 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: + 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: @@ -57,7 +67,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,12 +83,13 @@ def sync_detailed( body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: r"""Upload a file to a content source Upload a file to a content source. - **Maximum file size:** 209715200 bytes. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -115,6 +126,8 @@ def sync_detailed( - `video/x-msvideo` Notes: + - 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. - 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 @@ -128,6 +141,19 @@ def sync_detailed( - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (str): x_account_id (UUID | Unset): @@ -139,7 +165,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -163,12 +189,13 @@ def sync( body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: r"""Upload a file to a content source Upload a file to a content source. - **Maximum file size:** 209715200 bytes. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -205,6 +232,8 @@ def sync( - `video/x-msvideo` Notes: + - 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. - 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 @@ -218,6 +247,19 @@ def sync( - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (str): x_account_id (UUID | Unset): @@ -229,7 +271,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -248,12 +290,13 @@ async def asyncio_detailed( body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: r"""Upload a file to a content source Upload a file to a content source. - **Maximum file size:** 209715200 bytes. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -290,6 +333,8 @@ async def asyncio_detailed( - `video/x-msvideo` Notes: + - 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. - 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 @@ -303,6 +348,19 @@ async def asyncio_detailed( - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (str): x_account_id (UUID | Unset): @@ -314,7 +372,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -336,12 +394,13 @@ async def asyncio( body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: r"""Upload a file to a content source Upload a file to a content source. - **Maximum file size:** 209715200 bytes. + **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized + before it is stored). **Supported MIME types:** - `application/epub+zip` @@ -378,6 +437,8 @@ async def asyncio( - `video/x-msvideo` Notes: + - 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. - 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 @@ -391,6 +452,19 @@ async def asyncio( - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (str): x_account_id (UUID | Unset): @@ -402,7 +476,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 ec91232..67220e5 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 @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote from uuid import UUID @@ -9,6 +9,7 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.inline_text_upload_request import InlineTextUploadRequest +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -43,12 +44,21 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: + 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: @@ -57,7 +67,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,7 +83,7 @@ def sync_detailed( body: InlineTextUploadRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Upload inline text to a content source Upload a small text payload to a content source (no multipart/form-data required). @@ -91,9 +101,24 @@ def sync_detailed( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (UUID): x_account_id (UUID | Unset): @@ -105,7 +130,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -129,7 +154,7 @@ def sync( body: InlineTextUploadRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Upload inline text to a content source Upload a small text payload to a content source (no multipart/form-data required). @@ -147,9 +172,24 @@ def sync( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (UUID): x_account_id (UUID | Unset): @@ -161,7 +201,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -180,7 +220,7 @@ async def asyncio_detailed( body: InlineTextUploadRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: +) -> Response[Any | HTTPValidationError | ServiceUnavailableError]: """Upload inline text to a content source Upload a small text payload to a content source (no multipart/form-data required). @@ -198,9 +238,24 @@ async def asyncio_detailed( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (UUID): x_account_id (UUID | Unset): @@ -212,7 +267,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError] + Response[Any | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -234,7 +289,7 @@ async def asyncio( body: InlineTextUploadRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: +) -> Any | HTTPValidationError | ServiceUnavailableError | None: """Upload inline text to a content source Upload a small text payload to a content source (no multipart/form-data required). @@ -252,9 +307,24 @@ async def asyncio( - `text/xml` Notes: + - 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. - Use this endpoint for small text payloads; larger files should use `/upload`. - `title` is merged into `metadata.title` when not already present. + Tracking indexing progress: + - **Which id you get back depends on `status`, and they are not interchangeable:** + - `uploaded` — 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. + - `duplicate` — 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. + - 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=…&content_version_id=…` for + 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. + Args: source_connection_id (UUID): x_account_id (UUID | Unset): @@ -266,7 +336,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError + Any | HTTPValidationError | ServiceUnavailableError """ return ( 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 index 787051f..b6bc282 100644 --- a/seclai/_generated/api/version/get_api_version_api_version_get.py +++ b/seclai/_generated/api/version/get_api_version_api_version_get.py @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_version_response import ApiVersionResponse +from ...models.service_unavailable_error import ServiceUnavailableError from ...types import UNSET, Response, Unset @@ -33,12 +34,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiVersionResponse | None: +) -> ApiVersionResponse | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ApiVersionResponse.from_dict(response.json()) return response_200 + 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: @@ -47,7 +53,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiVersionResponse]: +) -> Response[ApiVersionResponse | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +67,7 @@ def sync_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse]: +) -> Response[ApiVersionResponse | ServiceUnavailableError]: """Get the account's API version Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request @@ -77,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiVersionResponse] + Response[ApiVersionResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -97,7 +103,7 @@ def sync( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | None: +) -> ApiVersionResponse | ServiceUnavailableError | None: """Get the account's API version Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request @@ -113,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiVersionResponse + ApiVersionResponse | ServiceUnavailableError """ return sync_detailed( @@ -128,7 +134,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse]: +) -> Response[ApiVersionResponse | ServiceUnavailableError]: """Get the account's API version Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request @@ -144,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiVersionResponse] + Response[ApiVersionResponse | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -162,7 +168,7 @@ async def asyncio( client: AuthenticatedClient | Client, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | None: +) -> ApiVersionResponse | ServiceUnavailableError | None: """Get the account's API version Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request @@ -178,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiVersionResponse + ApiVersionResponse | ServiceUnavailableError """ return ( 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 index a98e697..3936b5b 100644 --- a/seclai/_generated/api/version/update_api_version_api_version_put.py +++ b/seclai/_generated/api/version/update_api_version_api_version_put.py @@ -8,6 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.api_version_response import ApiVersionResponse from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError from ...models.update_api_version_request import UpdateApiVersionRequest from ...types import UNSET, Response, Unset @@ -40,7 +41,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiVersionResponse | HTTPValidationError | None: +) -> ApiVersionResponse | HTTPValidationError | ServiceUnavailableError | None: if response.status_code == 200: response_200 = ApiVersionResponse.from_dict(response.json()) @@ -51,6 +52,11 @@ def _parse_response( 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: @@ -59,7 +65,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiVersionResponse | HTTPValidationError]: +) -> Response[ApiVersionResponse | HTTPValidationError | ServiceUnavailableError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +80,7 @@ def sync_detailed( body: UpdateApiVersionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse | HTTPValidationError]: +) -> Response[ApiVersionResponse | HTTPValidationError | ServiceUnavailableError]: """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`. @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiVersionResponse | HTTPValidationError] + Response[ApiVersionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -114,7 +120,7 @@ def sync( body: UpdateApiVersionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | HTTPValidationError | None: +) -> ApiVersionResponse | HTTPValidationError | ServiceUnavailableError | 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`. @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiVersionResponse | HTTPValidationError + ApiVersionResponse | HTTPValidationError | ServiceUnavailableError """ return sync_detailed( @@ -149,7 +155,7 @@ async def asyncio_detailed( body: UpdateApiVersionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse | HTTPValidationError]: +) -> Response[ApiVersionResponse | HTTPValidationError | ServiceUnavailableError]: """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`. @@ -167,7 +173,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiVersionResponse | HTTPValidationError] + Response[ApiVersionResponse | HTTPValidationError | ServiceUnavailableError] """ kwargs = _get_kwargs( @@ -187,7 +193,7 @@ async def asyncio( body: UpdateApiVersionRequest, x_account_id: UUID | Unset = UNSET, seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | HTTPValidationError | None: +) -> ApiVersionResponse | HTTPValidationError | ServiceUnavailableError | 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`. @@ -205,7 +211,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiVersionResponse | HTTPValidationError + ApiVersionResponse | HTTPValidationError | ServiceUnavailableError """ return ( diff --git a/seclai/_generated/models/__init__.py b/seclai/_generated/models/__init__.py index 74d1c28..055d8a9 100644 --- a/seclai/_generated/models/__init__.py +++ b/seclai/_generated/models/__init__.py @@ -42,6 +42,7 @@ ) from .agent_list_response import AgentListResponse from .agent_run_attempt_response import AgentRunAttemptResponse +from .agent_run_file_response import AgentRunFileResponse from .agent_run_list_response import AgentRunListResponse from .agent_run_request import AgentRunRequest from .agent_run_request_metadata_type_0 import AgentRunRequestMetadataType0 @@ -57,6 +58,7 @@ from .agent_trace_match_response import AgentTraceMatchResponse from .agent_trace_search_request import AgentTraceSearchRequest from .agent_trace_search_response import AgentTraceSearchResponse +from .agent_using_cloud_drive_response_model import AgentUsingCloudDriveResponseModel from .ai_assistant_accept_request import AiAssistantAcceptRequest from .ai_assistant_accept_response import AiAssistantAcceptResponse from .ai_assistant_feedback_request import AiAssistantFeedbackRequest @@ -95,6 +97,12 @@ from .cancel_experiment_response import CancelExperimentResponse from .cancel_queued_runs_response import CancelQueuedRunsResponse from .change_status_request import ChangeStatusRequest +from .cloud_drive_access_level_response_model import CloudDriveAccessLevelResponseModel +from .cloud_drive_provider_response_model import CloudDriveProviderResponseModel +from .cloud_drive_rejection_response_model import CloudDriveRejectionResponseModel +from .cloud_drive_response_model import CloudDriveResponseModel +from .cloud_drive_scope_response_model import CloudDriveScopeResponseModel +from .cloud_drive_update_request import CloudDriveUpdateRequest from .compaction_evaluation_model import CompactionEvaluationModel from .compaction_scheduled_response import CompactionScheduledResponse from .compaction_test_response_model import CompactionTestResponseModel @@ -140,9 +148,14 @@ from .docs_search_api_docs_search_get_mode import DocsSearchApiDocsSearchGetMode from .docs_search_response import DocsSearchResponse from .docs_search_result_response import DocsSearchResultResponse +from .effort_options_response import EffortOptionsResponse from .email_domain_response import EmailDomainResponse from .email_domains_list_response import EmailDomainsListResponse from .email_trigger_config_response import EmailTriggerConfigResponse +from .embedding_modality_rate_response import EmbeddingModalityRateResponse +from .embedding_model_list_response import EmbeddingModelListResponse +from .embedding_model_response import EmbeddingModelResponse +from .embedding_storage_credits_response import EmbeddingStorageCreditsResponse from .estimate_export_request import EstimateExportRequest from .estimate_export_request_metadata_filter_type_0 import ( EstimateExportRequestMetadataFilterType0, @@ -176,6 +189,7 @@ from .example_prompt import ExamplePrompt from .executed_action_response import ExecutedActionResponse from .experiment_detail_response import ExperimentDetailResponse +from .experiment_detail_response_effort import ExperimentDetailResponseEffort from .experiment_detail_response_result_data_type_0 import ( ExperimentDetailResponseResultDataType0, ) @@ -277,6 +291,7 @@ PendingProcessingCompletedFailedStatus, ) from .playground_create_request import PlaygroundCreateRequest +from .playground_create_request_effort_type_0 import PlaygroundCreateRequestEffortType0 from .playground_create_request_evaluation_complexity import ( PlaygroundCreateRequestEvaluationComplexity, ) @@ -285,6 +300,9 @@ ) from .prompt_model_auto_upgrade_strategy import PromptModelAutoUpgradeStrategy from .prompt_model_response import PromptModelResponse +from .prompt_model_response_generation_credits_per_variant_type_0 import ( + PromptModelResponseGenerationCreditsPerVariantType0, +) from .prompt_model_response_generation_params_type_0 import ( PromptModelResponseGenerationParamsType0, ) @@ -300,10 +318,15 @@ from .proposed_policy_action_response_params import ProposedPolicyActionResponseParams from .provider_group_response import ProviderGroupResponse from .remove_email_domain_response import RemoveEmailDomainResponse +from .reranker_model_list_response import RerankerModelListResponse +from .reranker_model_response import RerankerModelResponse 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 .service_unavailable_error import ServiceUnavailableError +from .service_unavailable_error_error import ServiceUnavailableErrorError +from .service_unavailable_error_error_code import ServiceUnavailableErrorErrorCode from .set_auto_block_mode_request import SetAutoBlockModeRequest from .set_email_trigger_config_request import SetEmailTriggerConfigRequest from .solution_agent_response import SolutionAgentResponse @@ -317,6 +340,8 @@ from .solution_source_connection_response import SolutionSourceConnectionResponse from .solution_summary_response import SolutionSummaryResponse from .source_connection_response_model import SourceConnectionResponseModel +from .source_content_status_list_response import SourceContentStatusListResponse +from .source_content_status_response import SourceContentStatusResponse from .source_embedding_migration_response import SourceEmbeddingMigrationResponse from .source_index_mode import SourceIndexMode from .source_list_response import SourceListResponse @@ -393,6 +418,7 @@ "AgentImportPreviewResponseUnresolvedRefsItem", "AgentListResponse", "AgentRunAttemptResponse", + "AgentRunFileResponse", "AgentRunListResponse", "AgentRunRequest", "AgentRunRequestMetadataType0", @@ -406,6 +432,7 @@ "AgentTraceMatchResponse", "AgentTraceSearchRequest", "AgentTraceSearchResponse", + "AgentUsingCloudDriveResponseModel", "AiAssistantAcceptRequest", "AiAssistantAcceptResponse", "AiAssistantFeedbackRequest", @@ -436,6 +463,12 @@ "CancelExperimentResponse", "CancelQueuedRunsResponse", "ChangeStatusRequest", + "CloudDriveAccessLevelResponseModel", + "CloudDriveProviderResponseModel", + "CloudDriveRejectionResponseModel", + "CloudDriveResponseModel", + "CloudDriveScopeResponseModel", + "CloudDriveUpdateRequest", "CompactionEvaluationModel", "CompactionScheduledResponse", "CompactionTestResponseModel", @@ -469,9 +502,14 @@ "DocsSearchApiDocsSearchGetMode", "DocsSearchResponse", "DocsSearchResultResponse", + "EffortOptionsResponse", "EmailDomainResponse", "EmailDomainsListResponse", "EmailTriggerConfigResponse", + "EmbeddingModalityRateResponse", + "EmbeddingModelListResponse", + "EmbeddingModelResponse", + "EmbeddingStorageCreditsResponse", "EstimateExportRequest", "EstimateExportRequestMetadataFilterType0", "EstimateExportResponse", @@ -491,6 +529,7 @@ "ExamplePrompt", "ExecutedActionResponse", "ExperimentDetailResponse", + "ExperimentDetailResponseEffort", "ExperimentDetailResponseResultDataType0", "ExperimentListResponse", "ExperimentSummaryResponse", @@ -560,10 +599,12 @@ "PaginationResponse", "PendingProcessingCompletedFailedStatus", "PlaygroundCreateRequest", + "PlaygroundCreateRequestEffortType0", "PlaygroundCreateRequestEvaluationComplexity", "PlaygroundCreateRequestEvaluationMode", "PromptModelAutoUpgradeStrategy", "PromptModelResponse", + "PromptModelResponseGenerationCreditsPerVariantType0", "PromptModelResponseGenerationParamsType0", "PromptModelResponsePayloadSchemaType0", "PromptToolResponse", @@ -575,10 +616,15 @@ "ProposedPolicyActionResponseParams", "ProviderGroupResponse", "RemoveEmailDomainResponse", + "RerankerModelListResponse", + "RerankerModelResponse", "ResumeInboundResponse", "SearchResponse", "SearchResultResponse", "SendTestEmailResponse", + "ServiceUnavailableError", + "ServiceUnavailableErrorError", + "ServiceUnavailableErrorErrorCode", "SetAutoBlockModeRequest", "SetEmailTriggerConfigRequest", "SolutionAgentResponse", @@ -590,6 +636,8 @@ "SolutionSourceConnectionResponse", "SolutionSummaryResponse", "SourceConnectionResponseModel", + "SourceContentStatusListResponse", + "SourceContentStatusResponse", "SourceEmbeddingMigrationResponse", "SourceIndexMode", "SourceListResponse", diff --git a/seclai/_generated/models/agent_export_response.py b/seclai/_generated/models/agent_export_response.py index f51281a..1390350 100644 --- a/seclai/_generated/models/agent_export_response.py +++ b/seclai/_generated/models/agent_export_response.py @@ -39,7 +39,7 @@ class AgentExportResponse: 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"). + export_version (str): Schema version of the export format (currently "5"). 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. diff --git a/seclai/_generated/models/agent_run_file_response.py b/seclai/_generated/models/agent_run_file_response.py new file mode 100644 index 0000000..a508937 --- /dev/null +++ b/seclai/_generated/models/agent_run_file_response.py @@ -0,0 +1,109 @@ +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="AgentRunFileResponse") + + +@_attrs_define +class AgentRunFileResponse: + """A file in a run's or a step's output. + + Attributes: + bytes_ (int | None): Size of the file in bytes, when known. + download_url (str): `GET` URL that streams the file; accepts an API key or OAuth token. + id (UUID): File identifier, used to download it. + mime (str): MIME type of the file. + name (None | str): The file's name in this run, as sent to email recipients and webhooks and matched by + `{{attachments[...]}}` selectors. + """ + + bytes_: int | None + download_url: str + id: UUID + mime: str + name: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + bytes_: int | None + bytes_ = self.bytes_ + + download_url = self.download_url + + id = str(self.id) + + mime = self.mime + + name: None | str + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "bytes": bytes_, + "download_url": download_url, + "id": id, + "mime": mime, + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_bytes_(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + bytes_ = _parse_bytes_(d.pop("bytes")) + + download_url = d.pop("download_url") + + id = UUID(d.pop("id")) + + mime = d.pop("mime") + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + agent_run_file_response = cls( + bytes_=bytes_, + download_url=download_url, + id=id, + mime=mime, + name=name, + ) + + agent_run_file_response.additional_properties = d + return agent_run_file_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 index 2c22f9a..7c11e7b 100644 --- a/seclai/_generated/models/agent_run_request.py +++ b/seclai/_generated/models/agent_run_request.py @@ -22,8 +22,9 @@ 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. + 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 @@ -38,7 +39,9 @@ class AgentRunRequest: 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. + ``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. diff --git a/seclai/_generated/models/agent_run_response.py b/seclai/_generated/models/agent_run_response.py index 0b5c219..10f95ba 100644 --- a/seclai/_generated/models/agent_run_response.py +++ b/seclai/_generated/models/agent_run_response.py @@ -1,10 +1,12 @@ 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.pending_processing_completed_failed_status import ( PendingProcessingCompletedFailedStatus, @@ -13,6 +15,7 @@ if TYPE_CHECKING: from ..models.agent_run_attempt_response import AgentRunAttemptResponse + from ..models.agent_run_file_response import AgentRunFileResponse from ..models.agent_run_step_response import AgentRunStepResponse from ..models.governance_policy_ref_response import GovernancePolicyRefResponse @@ -25,13 +28,18 @@ 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. + credits_ (float | None): Credits consumed by the agent run, if applicable. Can still rise briefly after the run + ends, while governance screening finishes. 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. + 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. priority (bool): Indicates if the run was treated as a priority execution. run_id (str): Unique identifier for the agent run. status (PendingProcessingCompletedFailedStatus): + attachments (list[AgentRunFileResponse] | Unset): Files in the run's output, in order. Empty for runs that + produced none, for runs made before files were listed here, and once the run's trace is purged. 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 @@ -44,15 +52,18 @@ class AgentRunResponse: 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 + `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. + Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see + `output`); the same files are in `attachments` on every version, each with a `download_url`. 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. + 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 + 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. 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. @@ -66,6 +77,7 @@ class AgentRunResponse: priority: bool run_id: str status: PendingProcessingCompletedFailedStatus + attachments: list[AgentRunFileResponse] | Unset = UNSET blocked_policies: list[GovernancePolicyRefResponse] | Unset = UNSET flagged_policies: list[GovernancePolicyRefResponse] | Unset = UNSET governance_input_status: None | str | Unset = UNSET @@ -75,6 +87,7 @@ class AgentRunResponse: output_content_type: None | str | Unset = UNSET scan_wait_ms: int | None | Unset = UNSET steps: list[AgentRunStepResponse] | None | Unset = UNSET + trace_purged_at: datetime.datetime | None | Unset = UNSET wait_ms: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -101,6 +114,13 @@ def to_dict(self) -> dict[str, Any]: status = self.status.value + attachments: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.attachments, Unset): + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + attachments.append(attachments_item) + blocked_policies: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.blocked_policies, Unset): blocked_policies = [] @@ -163,6 +183,14 @@ def to_dict(self) -> dict[str, Any]: else: steps = self.steps + trace_purged_at: None | str | Unset + if isinstance(self.trace_purged_at, Unset): + trace_purged_at = UNSET + elif isinstance(self.trace_purged_at, datetime.datetime): + trace_purged_at = self.trace_purged_at.isoformat() + else: + trace_purged_at = self.trace_purged_at + wait_ms: int | None | Unset if isinstance(self.wait_ms, Unset): wait_ms = UNSET @@ -183,6 +211,8 @@ def to_dict(self) -> dict[str, Any]: "status": status, } ) + if attachments is not UNSET: + field_dict["attachments"] = attachments if blocked_policies is not UNSET: field_dict["blocked_policies"] = blocked_policies if flagged_policies is not UNSET: @@ -201,6 +231,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["scan_wait_ms"] = scan_wait_ms if steps is not UNSET: field_dict["steps"] = steps + if trace_purged_at is not UNSET: + field_dict["trace_purged_at"] = trace_purged_at if wait_ms is not UNSET: field_dict["wait_ms"] = wait_ms @@ -209,6 +241,7 @@ def to_dict(self) -> dict[str, Any]: @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_file_response import AgentRunFileResponse from ..models.agent_run_step_response import AgentRunStepResponse from ..models.governance_policy_ref_response import GovernancePolicyRefResponse @@ -249,6 +282,15 @@ def _parse_output(data: object) -> None | str: status = PendingProcessingCompletedFailedStatus(d.pop("status")) + _attachments = d.pop("attachments", UNSET) + attachments: list[AgentRunFileResponse] | Unset = UNSET + if _attachments is not UNSET: + attachments = [] + for attachments_item_data in _attachments: + attachments_item = AgentRunFileResponse.from_dict(attachments_item_data) + + attachments.append(attachments_item) + _blocked_policies = d.pop("blocked_policies", UNSET) blocked_policies: list[GovernancePolicyRefResponse] | Unset = UNSET if _blocked_policies is not UNSET: @@ -355,6 +397,23 @@ def _parse_steps(data: object) -> list[AgentRunStepResponse] | None | Unset: steps = _parse_steps(d.pop("steps", UNSET)) + def _parse_trace_purged_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() + trace_purged_at_type_0 = isoparse(data) + + return trace_purged_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + trace_purged_at = _parse_trace_purged_at(d.pop("trace_purged_at", UNSET)) + def _parse_wait_ms(data: object) -> int | None | Unset: if data is None: return data @@ -373,6 +432,7 @@ def _parse_wait_ms(data: object) -> int | None | Unset: priority=priority, run_id=run_id, status=status, + attachments=attachments, blocked_policies=blocked_policies, flagged_policies=flagged_policies, governance_input_status=governance_input_status, @@ -382,6 +442,7 @@ def _parse_wait_ms(data: object) -> int | None | Unset: output_content_type=output_content_type, scan_wait_ms=scan_wait_ms, steps=steps, + trace_purged_at=trace_purged_at, wait_ms=wait_ms, ) diff --git a/seclai/_generated/models/agent_run_step_response.py b/seclai/_generated/models/agent_run_step_response.py index cfc6b7e..74a7327 100644 --- a/seclai/_generated/models/agent_run_step_response.py +++ b/seclai/_generated/models/agent_run_step_response.py @@ -12,6 +12,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.agent_run_file_response import AgentRunFileResponse from ..models.agent_run_tool_call_response import AgentRunToolCallResponse @@ -23,17 +24,25 @@ class AgentRunStepResponse: """ Attributes: agent_step_id (str): Agent step identifier. - credits_used (float): Credits consumed by the step attempt, if applicable. + credits_used (float): Credits consumed by this step across every attempt it made. Some charges made outside any + step, such as governance screening of the run's input, count toward the run's total but no step's. The + timestamps above and the tool calls below describe the latest attempt only. 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. + input_ (None | str): Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest + JSON when the step that produced it output files and is not a `for_each`. + output (None | str): Output text produced by the step, if any; its files are in `attachments`. Below `Seclai- + Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. 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. + attachments (list[AgentRunFileResponse] | Unset): Files in this step's output, in order. Empty for steps that + 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. """ agent_step_id: str @@ -46,7 +55,9 @@ class AgentRunStepResponse: started_at: None | str status: PendingProcessingCompletedFailedStatus step_type: str + attachments: list[AgentRunFileResponse] | Unset = UNSET tool_calls: list[AgentRunToolCallResponse] | Unset = UNSET + warnings: list[str] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -76,6 +87,13 @@ def to_dict(self) -> dict[str, Any]: step_type = self.step_type + attachments: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.attachments, Unset): + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + attachments.append(attachments_item) + tool_calls: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.tool_calls, Unset): tool_calls = [] @@ -83,6 +101,15 @@ def to_dict(self) -> dict[str, Any]: tool_calls_item = tool_calls_item_data.to_dict() tool_calls.append(tool_calls_item) + warnings: list[str] | None | Unset + if isinstance(self.warnings, Unset): + warnings = UNSET + elif isinstance(self.warnings, list): + warnings = self.warnings + + else: + warnings = self.warnings + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -99,13 +126,18 @@ def to_dict(self) -> dict[str, Any]: "step_type": step_type, } ) + if attachments is not UNSET: + field_dict["attachments"] = attachments if tool_calls is not UNSET: field_dict["tool_calls"] = tool_calls + 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_run_file_response import AgentRunFileResponse from ..models.agent_run_tool_call_response import AgentRunToolCallResponse d = dict(src_dict) @@ -159,6 +191,15 @@ def _parse_started_at(data: object) -> None | str: step_type = d.pop("step_type") + _attachments = d.pop("attachments", UNSET) + attachments: list[AgentRunFileResponse] | Unset = UNSET + if _attachments is not UNSET: + attachments = [] + for attachments_item_data in _attachments: + attachments_item = AgentRunFileResponse.from_dict(attachments_item_data) + + attachments.append(attachments_item) + _tool_calls = d.pop("tool_calls", UNSET) tool_calls: list[AgentRunToolCallResponse] | Unset = UNSET if _tool_calls is not UNSET: @@ -170,6 +211,23 @@ def _parse_started_at(data: object) -> None | str: tool_calls.append(tool_calls_item) + def _parse_warnings(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() + warnings_type_0 = cast(list[str], data) + + return warnings_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + warnings = _parse_warnings(d.pop("warnings", UNSET)) + agent_run_step_response = cls( agent_step_id=agent_step_id, credits_used=credits_used, @@ -181,7 +239,9 @@ def _parse_started_at(data: object) -> None | str: started_at=started_at, status=status, step_type=step_type, + attachments=attachments, tool_calls=tool_calls, + warnings=warnings, ) agent_run_step_response.additional_properties = d diff --git a/seclai/_generated/models/agent_run_stream_request.py b/seclai/_generated/models/agent_run_stream_request.py index c3f68b4..003fb80 100644 --- a/seclai/_generated/models/agent_run_stream_request.py +++ b/seclai/_generated/models/agent_run_stream_request.py @@ -24,12 +24,13 @@ 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. + 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. 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. + patterns must all be satisfied or the run is rejected with 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- diff --git a/seclai/_generated/models/agent_run_tool_call_response.py b/seclai/_generated/models/agent_run_tool_call_response.py index 375f3fb..10fb98c 100644 --- a/seclai/_generated/models/agent_run_tool_call_response.py +++ b/seclai/_generated/models/agent_run_tool_call_response.py @@ -25,7 +25,8 @@ class AgentRunToolCallResponse: 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. + sequence (int | Unset): 0-based ordinal of this call within one attempt of the step, so it repeats across a + retried step's attempts. This list holds the latest attempt only. 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. """ diff --git a/seclai/_generated/models/agent_using_cloud_drive_response_model.py b/seclai/_generated/models/agent_using_cloud_drive_response_model.py new file mode 100644 index 0000000..c0387b1 --- /dev/null +++ b/seclai/_generated/models/agent_using_cloud_drive_response_model.py @@ -0,0 +1,93 @@ +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="AgentUsingCloudDriveResponseModel") + + +@_attrs_define +class AgentUsingCloudDriveResponseModel: + """ + Attributes: + agent_id (str): Agent identifier. + agent_name (str): Agent name. + trigger_types (list[str]): File-change trigger types bound to this drive. + via_prompt_tool (bool): Uses a prompt_call cloud-drive tool. + via_step (bool): Uses a list/read/write cloud-drive step. + """ + + agent_id: str + agent_name: str + trigger_types: list[str] + via_prompt_tool: bool + via_step: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + agent_id = self.agent_id + + agent_name = self.agent_name + + trigger_types = self.trigger_types + + via_prompt_tool = self.via_prompt_tool + + via_step = self.via_step + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "agent_id": agent_id, + "agent_name": agent_name, + "trigger_types": trigger_types, + "via_prompt_tool": via_prompt_tool, + "via_step": via_step, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_id = d.pop("agent_id") + + agent_name = d.pop("agent_name") + + trigger_types = cast(list[str], d.pop("trigger_types")) + + via_prompt_tool = d.pop("via_prompt_tool") + + via_step = d.pop("via_step") + + agent_using_cloud_drive_response_model = cls( + agent_id=agent_id, + agent_name=agent_name, + trigger_types=trigger_types, + via_prompt_tool=via_prompt_tool, + via_step=via_step, + ) + + agent_using_cloud_drive_response_model.additional_properties = d + return agent_using_cloud_drive_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/ai_assistant_feedback_request.py b/seclai/_generated/models/ai_assistant_feedback_request.py index 0bf4264..dde3c00 100644 --- a/seclai/_generated/models/ai_assistant_feedback_request.py +++ b/seclai/_generated/models/ai_assistant_feedback_request.py @@ -29,6 +29,7 @@ class AiAssistantFeedbackRequest: comment (None | str | Unset): Optional comment. context (AiAssistantFeedbackRequestContextType0 | None | Unset): Additional context. conversation_id (None | Unset | UUID): Conversation ID for the interaction. + governance_conversation_id (None | Unset | UUID): Governance conversation ID, if applicable. prompt_call_id (None | Unset | UUID): Prompt call ID for credit tracking. """ @@ -38,6 +39,7 @@ class AiAssistantFeedbackRequest: comment: None | str | Unset = UNSET context: AiAssistantFeedbackRequestContextType0 | None | Unset = UNSET conversation_id: None | Unset | UUID = UNSET + governance_conversation_id: None | Unset | UUID = UNSET prompt_call_id: None | Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -80,6 +82,14 @@ def to_dict(self) -> dict[str, Any]: else: conversation_id = self.conversation_id + governance_conversation_id: None | str | Unset + if isinstance(self.governance_conversation_id, Unset): + governance_conversation_id = UNSET + elif isinstance(self.governance_conversation_id, UUID): + governance_conversation_id = str(self.governance_conversation_id) + else: + governance_conversation_id = self.governance_conversation_id + prompt_call_id: None | str | Unset if isinstance(self.prompt_call_id, Unset): prompt_call_id = UNSET @@ -104,6 +114,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["context"] = context if conversation_id is not UNSET: field_dict["conversation_id"] = conversation_id + if governance_conversation_id is not UNSET: + field_dict["governance_conversation_id"] = governance_conversation_id if prompt_call_id is not UNSET: field_dict["prompt_call_id"] = prompt_call_id @@ -184,6 +196,25 @@ def _parse_conversation_id(data: object) -> None | Unset | UUID: conversation_id = _parse_conversation_id(d.pop("conversation_id", UNSET)) + def _parse_governance_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() + governance_conversation_id_type_0 = UUID(data) + + return governance_conversation_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | UUID, data) + + governance_conversation_id = _parse_governance_conversation_id( + d.pop("governance_conversation_id", UNSET) + ) + def _parse_prompt_call_id(data: object) -> None | Unset | UUID: if data is None: return data @@ -208,6 +239,7 @@ def _parse_prompt_call_id(data: object) -> None | Unset | UUID: comment=comment, context=context, conversation_id=conversation_id, + governance_conversation_id=governance_conversation_id, prompt_call_id=prompt_call_id, ) diff --git a/seclai/_generated/models/cloud_drive_access_level_response_model.py b/seclai/_generated/models/cloud_drive_access_level_response_model.py new file mode 100644 index 0000000..c1270e7 --- /dev/null +++ b/seclai/_generated/models/cloud_drive_access_level_response_model.py @@ -0,0 +1,85 @@ +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="CloudDriveAccessLevelResponseModel") + + +@_attrs_define +class CloudDriveAccessLevelResponseModel: + """ + Attributes: + default (bool): Whether connecting without a choice uses it. + description (str): What agents can do at this level. + key (str): Level identifier, e.g. `read_write`/`read_only`. + label (str): Short human-readable name. + """ + + default: bool + description: str + key: str + label: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + default = self.default + + description = self.description + + key = self.key + + label = self.label + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "default": default, + "description": description, + "key": key, + "label": label, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + default = d.pop("default") + + description = d.pop("description") + + key = d.pop("key") + + label = d.pop("label") + + cloud_drive_access_level_response_model = cls( + default=default, + description=description, + key=key, + label=label, + ) + + cloud_drive_access_level_response_model.additional_properties = d + return cloud_drive_access_level_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/cloud_drive_provider_response_model.py b/seclai/_generated/models/cloud_drive_provider_response_model.py new file mode 100644 index 0000000..1d15a59 --- /dev/null +++ b/seclai/_generated/models/cloud_drive_provider_response_model.py @@ -0,0 +1,119 @@ +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.cloud_drive_access_level_response_model import ( + CloudDriveAccessLevelResponseModel, + ) + from ..models.cloud_drive_scope_response_model import CloudDriveScopeResponseModel + + +T = TypeVar("T", bound="CloudDriveProviderResponseModel") + + +@_attrs_define +class CloudDriveProviderResponseModel: + """ + Attributes: + access_levels (list[CloudDriveAccessLevelResponseModel]): Mutually-exclusive permission bundles offered when + connecting. Connecting happens in the app, so this is informational here — it explains what a connection's + `access_level` can be. + display_name (str): Human-readable provider name. + key (str): Provider key used as `provider` on a connection. + scopes (list[CloudDriveScopeResponseModel]): OAuth permissions this provider can request. + """ + + access_levels: list[CloudDriveAccessLevelResponseModel] + display_name: str + key: str + scopes: list[CloudDriveScopeResponseModel] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_levels = [] + for access_levels_item_data in self.access_levels: + access_levels_item = access_levels_item_data.to_dict() + access_levels.append(access_levels_item) + + display_name = self.display_name + + key = self.key + + scopes = [] + for scopes_item_data in self.scopes: + scopes_item = scopes_item_data.to_dict() + scopes.append(scopes_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "access_levels": access_levels, + "display_name": display_name, + "key": key, + "scopes": scopes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.cloud_drive_access_level_response_model import ( + CloudDriveAccessLevelResponseModel, + ) + from ..models.cloud_drive_scope_response_model import ( + CloudDriveScopeResponseModel, + ) + + d = dict(src_dict) + access_levels = [] + _access_levels = d.pop("access_levels") + for access_levels_item_data in _access_levels: + access_levels_item = CloudDriveAccessLevelResponseModel.from_dict( + access_levels_item_data + ) + + access_levels.append(access_levels_item) + + display_name = d.pop("display_name") + + key = d.pop("key") + + scopes = [] + _scopes = d.pop("scopes") + for scopes_item_data in _scopes: + scopes_item = CloudDriveScopeResponseModel.from_dict(scopes_item_data) + + scopes.append(scopes_item) + + cloud_drive_provider_response_model = cls( + access_levels=access_levels, + display_name=display_name, + key=key, + scopes=scopes, + ) + + cloud_drive_provider_response_model.additional_properties = d + return cloud_drive_provider_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/cloud_drive_rejection_response_model.py b/seclai/_generated/models/cloud_drive_rejection_response_model.py new file mode 100644 index 0000000..5eacd45 --- /dev/null +++ b/seclai/_generated/models/cloud_drive_rejection_response_model.py @@ -0,0 +1,140 @@ +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="CloudDriveRejectionResponseModel") + + +@_attrs_define +class CloudDriveRejectionResponseModel: + """One file the connection deliberately did not process. + + Attributes: + created_at (str): When the file was skipped. + id (str): Rejection identifier. + reason (str): `too_large`, `download_failed`, or `flood`. + detail (None | str | Unset): Extra context, e.g. the cap that was hit. + file_id (None | str | Unset): The provider's file id, when the file was known. + file_path (None | str | Unset): Path of the skipped file, when known. + """ + + created_at: str + id: str + reason: str + detail: None | str | Unset = UNSET + file_id: None | str | Unset = UNSET + file_path: 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 + + reason = self.reason + + detail: None | str | Unset + if isinstance(self.detail, Unset): + detail = UNSET + else: + detail = self.detail + + file_id: None | str | Unset + if isinstance(self.file_id, Unset): + file_id = UNSET + else: + file_id = self.file_id + + file_path: None | str | Unset + if isinstance(self.file_path, Unset): + file_path = UNSET + else: + file_path = self.file_path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "id": id, + "reason": reason, + } + ) + if detail is not UNSET: + field_dict["detail"] = detail + if file_id is not UNSET: + field_dict["file_id"] = file_id + if file_path is not UNSET: + field_dict["file_path"] = file_path + + 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") + + reason = d.pop("reason") + + 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_file_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + file_id = _parse_file_id(d.pop("file_id", UNSET)) + + def _parse_file_path(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + file_path = _parse_file_path(d.pop("file_path", UNSET)) + + cloud_drive_rejection_response_model = cls( + created_at=created_at, + id=id, + reason=reason, + detail=detail, + file_id=file_id, + file_path=file_path, + ) + + cloud_drive_rejection_response_model.additional_properties = d + return cloud_drive_rejection_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/cloud_drive_response_model.py b/seclai/_generated/models/cloud_drive_response_model.py new file mode 100644 index 0000000..291c73a --- /dev/null +++ b/seclai/_generated/models/cloud_drive_response_model.py @@ -0,0 +1,298 @@ +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="CloudDriveResponseModel") + + +@_attrs_define +class CloudDriveResponseModel: + """A cloud-drive connection, without any secret material. + + Attributes: + connected (bool): True when the connection is usable. + created_at (str): When the connection was created. + drive_name_stale (bool): True when `drive_name` could not be re-confirmed (the drive was deleted, access was + lost, or the provider was unreachable). The last known name is still reported — treat it as possibly out of date + rather than current. + folder_path (str): Watched folder; empty string means the drive root. A folder on a shared drive is written + `/Shared drives//`. + id (str): Connection identifier. + provider (str): Provider key, e.g. `dropbox` or `google_drive`. + realtime_updates (bool): True when changes arrive via the provider's push notifications. False means the drive + still syncs, but only on the scheduled backstop sweep rather than within seconds of a change. + status (str): One of `active`, `pending_auth`, `error`, `disconnected`. + updated_at (str): When the connection was last modified. + access_level (None | str | Unset): The permission bundle the granted scopes correspond to — `read_write` or + `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather + than assuming write access. + drive_id (None | str | Unset): Opaque id of the shared drive the folder resolves to, or null for the user's own + drive. Stable across renames — compare on this rather than on the name in `folder_path`. + drive_name (None | str | Unset): Display name the shared drive last resolved to. Presentation only; never match + on it. + external_account_id (None | str | Unset): The provider's own opaque account identifier (never an email). + last_error (None | str | Unset): Most recent sync or authorization error, if any. + last_synced_at (None | str | Unset): When the connection last synced successfully. + name (None | str | Unset): Human-readable name. + oauth_scopes (None | str | Unset): Space-separated OAuth scopes granted to this connection. + """ + + connected: bool + created_at: str + drive_name_stale: bool + folder_path: str + id: str + provider: str + realtime_updates: bool + status: str + updated_at: str + access_level: None | str | Unset = UNSET + drive_id: None | str | Unset = UNSET + drive_name: None | str | Unset = UNSET + external_account_id: None | str | Unset = UNSET + last_error: None | str | Unset = UNSET + last_synced_at: None | str | Unset = UNSET + name: None | str | Unset = UNSET + oauth_scopes: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + connected = self.connected + + created_at = self.created_at + + drive_name_stale = self.drive_name_stale + + folder_path = self.folder_path + + id = self.id + + provider = self.provider + + realtime_updates = self.realtime_updates + + status = self.status + + updated_at = self.updated_at + + access_level: None | str | Unset + if isinstance(self.access_level, Unset): + access_level = UNSET + else: + access_level = self.access_level + + drive_id: None | str | Unset + if isinstance(self.drive_id, Unset): + drive_id = UNSET + else: + drive_id = self.drive_id + + drive_name: None | str | Unset + if isinstance(self.drive_name, Unset): + drive_name = UNSET + else: + drive_name = self.drive_name + + external_account_id: None | str | Unset + if isinstance(self.external_account_id, Unset): + external_account_id = UNSET + else: + external_account_id = self.external_account_id + + last_error: None | str | Unset + if isinstance(self.last_error, Unset): + last_error = UNSET + else: + last_error = self.last_error + + last_synced_at: None | str | Unset + if isinstance(self.last_synced_at, Unset): + last_synced_at = UNSET + else: + last_synced_at = self.last_synced_at + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + oauth_scopes: None | str | Unset + if isinstance(self.oauth_scopes, Unset): + oauth_scopes = UNSET + else: + oauth_scopes = self.oauth_scopes + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "connected": connected, + "created_at": created_at, + "drive_name_stale": drive_name_stale, + "folder_path": folder_path, + "id": id, + "provider": provider, + "realtime_updates": realtime_updates, + "status": status, + "updated_at": updated_at, + } + ) + if access_level is not UNSET: + field_dict["access_level"] = access_level + if drive_id is not UNSET: + field_dict["drive_id"] = drive_id + if drive_name is not UNSET: + field_dict["drive_name"] = drive_name + if external_account_id is not UNSET: + field_dict["external_account_id"] = external_account_id + if last_error is not UNSET: + field_dict["last_error"] = last_error + if last_synced_at is not UNSET: + field_dict["last_synced_at"] = last_synced_at + if name is not UNSET: + field_dict["name"] = name + if oauth_scopes is not UNSET: + field_dict["oauth_scopes"] = oauth_scopes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + connected = d.pop("connected") + + created_at = d.pop("created_at") + + drive_name_stale = d.pop("drive_name_stale") + + folder_path = d.pop("folder_path") + + id = d.pop("id") + + provider = d.pop("provider") + + realtime_updates = d.pop("realtime_updates") + + status = d.pop("status") + + updated_at = d.pop("updated_at") + + def _parse_access_level(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + access_level = _parse_access_level(d.pop("access_level", UNSET)) + + def _parse_drive_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + drive_id = _parse_drive_id(d.pop("drive_id", UNSET)) + + def _parse_drive_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + drive_name = _parse_drive_name(d.pop("drive_name", UNSET)) + + def _parse_external_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) + + external_account_id = _parse_external_account_id( + d.pop("external_account_id", UNSET) + ) + + def _parse_last_error(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + last_error = _parse_last_error(d.pop("last_error", UNSET)) + + def _parse_last_synced_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + last_synced_at = _parse_last_synced_at(d.pop("last_synced_at", 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_oauth_scopes(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + oauth_scopes = _parse_oauth_scopes(d.pop("oauth_scopes", UNSET)) + + cloud_drive_response_model = cls( + connected=connected, + created_at=created_at, + drive_name_stale=drive_name_stale, + folder_path=folder_path, + id=id, + provider=provider, + realtime_updates=realtime_updates, + status=status, + updated_at=updated_at, + access_level=access_level, + drive_id=drive_id, + drive_name=drive_name, + external_account_id=external_account_id, + last_error=last_error, + last_synced_at=last_synced_at, + name=name, + oauth_scopes=oauth_scopes, + ) + + cloud_drive_response_model.additional_properties = d + return cloud_drive_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/cloud_drive_scope_response_model.py b/seclai/_generated/models/cloud_drive_scope_response_model.py new file mode 100644 index 0000000..b279b71 --- /dev/null +++ b/seclai/_generated/models/cloud_drive_scope_response_model.py @@ -0,0 +1,85 @@ +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="CloudDriveScopeResponseModel") + + +@_attrs_define +class CloudDriveScopeResponseModel: + """ + Attributes: + description (str): What the scope allows. + key (str): The OAuth scope string sent to the provider. + label (str): Short human-readable name. + recommended (bool): Whether this scope is requested by default on connect. + """ + + description: str + key: str + label: str + recommended: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + description = self.description + + key = self.key + + label = self.label + + recommended = self.recommended + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "description": description, + "key": key, + "label": label, + "recommended": recommended, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + description = d.pop("description") + + key = d.pop("key") + + label = d.pop("label") + + recommended = d.pop("recommended") + + cloud_drive_scope_response_model = cls( + description=description, + key=key, + label=label, + recommended=recommended, + ) + + cloud_drive_scope_response_model.additional_properties = d + return cloud_drive_scope_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/cloud_drive_update_request.py b/seclai/_generated/models/cloud_drive_update_request.py new file mode 100644 index 0000000..ae75ed0 --- /dev/null +++ b/seclai/_generated/models/cloud_drive_update_request.py @@ -0,0 +1,96 @@ +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="CloudDriveUpdateRequest") + + +@_attrs_define +class CloudDriveUpdateRequest: + """ + Attributes: + folder_path (None | str | Unset): New watched folder; empty means the whole drive. A folder on a shared drive is + written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new + folder are NOT replayed as triggers — only subsequent changes fire, matching connect-time behaviour. Rejected + when the new folder would make an agent that writes there re-trigger itself. + name (None | str | Unset): New display name for the connection. + """ + + folder_path: 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]: + folder_path: None | str | Unset + if isinstance(self.folder_path, Unset): + folder_path = UNSET + else: + folder_path = self.folder_path + + 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 folder_path is not UNSET: + field_dict["folder_path"] = folder_path + 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_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) + + folder_path = _parse_folder_path(d.pop("folder_path", 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)) + + cloud_drive_update_request = cls( + folder_path=folder_path, + name=name, + ) + + cloud_drive_update_request.additional_properties = d + return cloud_drive_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/models/content_detail_response.py b/seclai/_generated/models/content_detail_response.py index 7e5fbff..ea34be0 100644 --- a/seclai/_generated/models/content_detail_response.py +++ b/seclai/_generated/models/content_detail_response.py @@ -6,6 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + if TYPE_CHECKING: from ..models.content_detail_response_metadata_type_0_item import ( ContentDetailResponseMetadataType0Item, @@ -42,6 +44,18 @@ class ContentDetailResponse: 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. + 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. + 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. """ content_duration: int | None @@ -66,6 +80,9 @@ class ContentDetailResponse: text_content_start: int text_content_total_length: int title: None | str + extracted_media_capped: bool | Unset = False + extracted_media_count: int | None | Unset = UNSET + extracted_media_limit: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -129,6 +146,20 @@ def to_dict(self) -> dict[str, Any]: title: None | str title = self.title + extracted_media_capped = self.extracted_media_capped + + extracted_media_count: int | None | Unset + if isinstance(self.extracted_media_count, Unset): + extracted_media_count = UNSET + else: + extracted_media_count = self.extracted_media_count + + extracted_media_limit: int | None | Unset + if isinstance(self.extracted_media_limit, Unset): + extracted_media_limit = UNSET + else: + extracted_media_limit = self.extracted_media_limit + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -157,6 +188,12 @@ def to_dict(self) -> dict[str, Any]: "title": title, } ) + if extracted_media_capped is not UNSET: + field_dict["extracted_media_capped"] = extracted_media_capped + if extracted_media_count is not UNSET: + field_dict["extracted_media_count"] = extracted_media_count + if extracted_media_limit is not UNSET: + field_dict["extracted_media_limit"] = extracted_media_limit return field_dict @@ -280,6 +317,30 @@ def _parse_title(data: object) -> None | str: title = _parse_title(d.pop("title")) + extracted_media_capped = d.pop("extracted_media_capped", UNSET) + + def _parse_extracted_media_count(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + extracted_media_count = _parse_extracted_media_count( + d.pop("extracted_media_count", UNSET) + ) + + def _parse_extracted_media_limit(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + extracted_media_limit = _parse_extracted_media_limit( + d.pop("extracted_media_limit", UNSET) + ) + content_detail_response = cls( content_duration=content_duration, content_duration_display=content_duration_display, @@ -303,6 +364,9 @@ def _parse_title(data: object) -> None | str: text_content_start=text_content_start, text_content_total_length=text_content_total_length, title=title, + extracted_media_capped=extracted_media_capped, + extracted_media_count=extracted_media_count, + extracted_media_limit=extracted_media_limit, ) content_detail_response.additional_properties = d diff --git a/seclai/_generated/models/content_embedding_response.py b/seclai/_generated/models/content_embedding_response.py index ea22bf7..b12f233 100644 --- a/seclai/_generated/models/content_embedding_response.py +++ b/seclai/_generated/models/content_embedding_response.py @@ -6,6 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="ContentEmbeddingResponse") @@ -21,6 +23,10 @@ class ContentEmbeddingResponse: text_end (int): text_start (int): vector (list[float]): + media_name (None | str | Unset): + page_number (int | None | Unset): + source_mime (None | str | Unset): + source_url (None | str | Unset): """ batch_duration: float @@ -30,6 +36,10 @@ class ContentEmbeddingResponse: text_end: int text_start: int vector: list[float] + media_name: None | str | Unset = UNSET + page_number: int | None | Unset = UNSET + source_mime: None | str | Unset = UNSET + source_url: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,6 +57,30 @@ def to_dict(self) -> dict[str, Any]: vector = self.vector + media_name: None | str | Unset + if isinstance(self.media_name, Unset): + media_name = UNSET + else: + media_name = self.media_name + + page_number: int | None | Unset + if isinstance(self.page_number, Unset): + page_number = UNSET + else: + page_number = self.page_number + + source_mime: None | str | Unset + if isinstance(self.source_mime, Unset): + source_mime = UNSET + else: + source_mime = self.source_mime + + source_url: None | str | Unset + if isinstance(self.source_url, Unset): + source_url = UNSET + else: + source_url = self.source_url + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -60,6 +94,14 @@ def to_dict(self) -> dict[str, Any]: "vector": vector, } ) + if media_name is not UNSET: + field_dict["media_name"] = media_name + if page_number is not UNSET: + field_dict["page_number"] = page_number + if source_mime is not UNSET: + field_dict["source_mime"] = source_mime + if source_url is not UNSET: + field_dict["source_url"] = source_url return field_dict @@ -80,6 +122,42 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: vector = cast(list[float], d.pop("vector")) + def _parse_media_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + media_name = _parse_media_name(d.pop("media_name", UNSET)) + + def _parse_page_number(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + page_number = _parse_page_number(d.pop("page_number", UNSET)) + + def _parse_source_mime(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_mime = _parse_source_mime(d.pop("source_mime", UNSET)) + + def _parse_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) + + source_url = _parse_source_url(d.pop("source_url", UNSET)) + content_embedding_response = cls( batch_duration=batch_duration, batch_size=batch_size, @@ -88,6 +166,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text_end=text_end, text_start=text_start, vector=vector, + media_name=media_name, + page_number=page_number, + source_mime=source_mime, + source_url=source_url, ) content_embedding_response.additional_properties = d diff --git a/seclai/_generated/models/create_alert_config_request.py b/seclai/_generated/models/create_alert_config_request.py index aacc073..2d9d184 100644 --- a/seclai/_generated/models/create_alert_config_request.py +++ b/seclai/_generated/models/create_alert_config_request.py @@ -23,7 +23,8 @@ 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. + cooldown_minutes (int | None | Unset): Cooldown period in minutes. Omit to use the per-alert-type default (1440 + for credit alerts, 60 otherwise). 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 @@ -33,7 +34,7 @@ class CreateAlertConfigRequest: alert_type: str agent_id: None | str | Unset = UNSET - cooldown_minutes: int | Unset = 60 + cooldown_minutes: int | None | Unset = UNSET distribution_type: str | Unset = "owner" enabled: bool | Unset = True recipient_user_ids: list[str] | None | Unset = UNSET @@ -54,7 +55,11 @@ def to_dict(self) -> dict[str, Any]: else: agent_id = self.agent_id - cooldown_minutes = self.cooldown_minutes + cooldown_minutes: int | None | Unset + if isinstance(self.cooldown_minutes, Unset): + cooldown_minutes = UNSET + else: + cooldown_minutes = self.cooldown_minutes distribution_type = self.distribution_type @@ -125,7 +130,14 @@ def _parse_agent_id(data: object) -> None | str | Unset: agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) - cooldown_minutes = d.pop("cooldown_minutes", UNSET) + 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)) distribution_type = d.pop("distribution_type", UNSET) diff --git a/seclai/_generated/models/create_knowledge_base_body.py b/seclai/_generated/models/create_knowledge_base_body.py index ab3e793..2ebec19 100644 --- a/seclai/_generated/models/create_knowledge_base_body.py +++ b/seclai/_generated/models/create_knowledge_base_body.py @@ -18,11 +18,17 @@ class CreateKnowledgeBaseBody: 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. + default_score_threshold (float | None | Unset): Prefilled into Minimum Rerank Score on a new retrieval step in + the editor. Not applied at retrieval time — the step's own value is used. + default_top_k (int | None | Unset): Prefilled into Top K on a new retrieval step in the editor. Not applied at + retrieval time. + default_top_n (int | None | Unset): Prefilled into Top N on a new retrieval step in the editor. Not applied at + retrieval time — the step's own value is used. description (None | str | Unset): Optional description. - reranker_model (None | str | Unset): Reranker model to use (null for no reranking). + reranker_model (None | str | Unset): Reranker model to use — a `model_type` from `GET /models/rerankers`. Pass + "none" to disable reranking (not a value from that list). Omit it for a default chosen from the sources ("none" + when every source embeds media natively, whose chunks carry no text for a reranker to score). "" is accepted as + a synonym for "none". """ name: str diff --git a/seclai/_generated/models/create_memory_bank_body.py b/seclai/_generated/models/create_memory_bank_body.py index 9526b45..34dc514 100644 --- a/seclai/_generated/models/create_memory_bank_body.py +++ b/seclai/_generated/models/create_memory_bank_body.py @@ -24,15 +24,29 @@ class CreateMemoryBankBody: 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_age_days (int | None | Unset): DEPRECATED and no longer applied. Age used to trigger compaction, which + duplicated retention_days — both removed the same entries at the same age. Age now belongs solely to + retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for + clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients. 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. + retention_days (int | None | Unset): Retention in days — when entries are deleted outright, text and embeddings. + This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending + Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, + indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank — + unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the + caller expressed — while a general bank keeps entries indefinitely. Send an explicit value (or null for + indefinite) to be unambiguous on every version. + strip_quoted_reply_chains (bool | Unset): Conversation banks only. When true, a conversation turn written to + this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) + turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped + (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a + one-character change inside a link, address or amount, unless the change is only to that edge punctuation. + Default: False. type_ (str | Unset): Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key. Default: 'conversation'. """ @@ -48,7 +62,8 @@ class CreateMemoryBankBody: 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 + retention_days: int | None | Unset = UNSET + strip_quoted_reply_chains: bool | Unset = False type_: str | Unset = "conversation" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -117,6 +132,8 @@ def to_dict(self) -> dict[str, Any]: else: retention_days = self.retention_days + strip_quoted_reply_chains = self.strip_quoted_reply_chains + type_ = self.type_ field_dict: dict[str, Any] = {} @@ -148,6 +165,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["mode"] = mode if retention_days is not UNSET: field_dict["retention_days"] = retention_days + if strip_quoted_reply_chains is not UNSET: + field_dict["strip_quoted_reply_chains"] = strip_quoted_reply_chains if type_ is not UNSET: field_dict["type"] = type_ @@ -250,6 +269,8 @@ def _parse_retention_days(data: object) -> int | None | Unset: retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) + strip_quoted_reply_chains = d.pop("strip_quoted_reply_chains", UNSET) + type_ = d.pop("type", UNSET) create_memory_bank_body = cls( @@ -265,6 +286,7 @@ def _parse_retention_days(data: object) -> int | None | Unset: max_turns=max_turns, mode=mode, retention_days=retention_days, + strip_quoted_reply_chains=strip_quoted_reply_chains, type_=type_, ) diff --git a/seclai/_generated/models/create_source_body.py b/seclai/_generated/models/create_source_body.py index 41bb672..1c14469 100644 --- a/seclai/_generated/models/create_source_body.py +++ b/seclai/_generated/models/create_source_body.py @@ -24,12 +24,15 @@ class CreateSourceBody: 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. + 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. 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. + 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. 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. diff --git a/seclai/_generated/models/effort_options_response.py b/seclai/_generated/models/effort_options_response.py new file mode 100644 index 0000000..789b579 --- /dev/null +++ b/seclai/_generated/models/effort_options_response.py @@ -0,0 +1,95 @@ +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="EffortOptionsResponse") + + +@_attrs_define +class EffortOptionsResponse: + """The reasoning-effort values a model accepts. + + Attributes: + kind (str): `levels` today: `values` lists them. + default (None | str | Unset): The vendor's default level, when known. + values (list[str] | Unset): Accepted values, weakest first. + """ + + kind: str + default: None | str | Unset = UNSET + values: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind = self.kind + + default: None | str | Unset + if isinstance(self.default, Unset): + default = UNSET + else: + default = self.default + + values: list[str] | Unset = UNSET + if not isinstance(self.values, Unset): + values = self.values + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kind": kind, + } + ) + if default is not UNSET: + field_dict["default"] = default + if values is not UNSET: + field_dict["values"] = values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = d.pop("kind") + + def _parse_default(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + default = _parse_default(d.pop("default", UNSET)) + + values = cast(list[str], d.pop("values", UNSET)) + + effort_options_response = cls( + kind=kind, + default=default, + values=values, + ) + + effort_options_response.additional_properties = d + return effort_options_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/embedding_modality_rate_response.py b/seclai/_generated/models/embedding_modality_rate_response.py new file mode 100644 index 0000000..e0d2c12 --- /dev/null +++ b/seclai/_generated/models/embedding_modality_rate_response.py @@ -0,0 +1,85 @@ +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="EmbeddingModalityRateResponse") + + +@_attrs_define +class EmbeddingModalityRateResponse: + """Per-modality rate for a multi-modal embedder. + + The default ``credits`` field on :class:`EmbeddingModelResponse` is the + text rate (credits per ~1k English words). Embedders that index image or + video chunks natively charge those modalities at a different rate and unit + — e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices + video per second. Surfacing the modality and unit lets a caller render an + honest cost breakdown alongside the text rate. + + Attributes: + credits_ (float): Rate value in the unit below + modality (str): Modality kind, e.g. image / video + unit (str): Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens). + """ + + credits_: float + modality: str + unit: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + credits_ = self.credits_ + + modality = self.modality + + unit = self.unit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "credits": credits_, + "modality": modality, + "unit": unit, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + credits_ = d.pop("credits") + + modality = d.pop("modality") + + unit = d.pop("unit") + + embedding_modality_rate_response = cls( + credits_=credits_, + modality=modality, + unit=unit, + ) + + embedding_modality_rate_response.additional_properties = d + return embedding_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/embedding_model_list_response.py b/seclai/_generated/models/embedding_model_list_response.py new file mode 100644 index 0000000..4a00a12 --- /dev/null +++ b/seclai/_generated/models/embedding_model_list_response.py @@ -0,0 +1,152 @@ +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.embedding_model_response import EmbeddingModelResponse + from ..models.embedding_storage_credits_response import ( + EmbeddingStorageCreditsResponse, + ) + + +T = TypeVar("T", bound="EmbeddingModelListResponse") + + +@_attrs_define +class EmbeddingModelListResponse: + """Legacy (header-less) response shape for the embedder catalog. + + Attributes: + file_processing_credits_per_mb (float): Credits per MB for file processing at ingest + models (list[EmbeddingModelResponse]): Available embedding models + storage_credits (list[EmbeddingStorageCreditsResponse]): Monthly storage credits per dimension count + default_dimension (int | None | Unset): Dimensions used with the default embedding model + default_model_type (None | str | Unset): Embedding model used when a source does not override it + """ + + file_processing_credits_per_mb: float + models: list[EmbeddingModelResponse] + storage_credits: list[EmbeddingStorageCreditsResponse] + 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]: + file_processing_credits_per_mb = self.file_processing_credits_per_mb + + 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( + { + "file_processing_credits_per_mb": file_processing_credits_per_mb, + "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.embedding_model_response import EmbeddingModelResponse + from ..models.embedding_storage_credits_response import ( + EmbeddingStorageCreditsResponse, + ) + + d = dict(src_dict) + file_processing_credits_per_mb = d.pop("file_processing_credits_per_mb") + + models = [] + _models = d.pop("models") + for models_item_data in _models: + models_item = EmbeddingModelResponse.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 = EmbeddingStorageCreditsResponse.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_model_list_response = cls( + file_processing_credits_per_mb=file_processing_credits_per_mb, + models=models, + storage_credits=storage_credits, + default_dimension=default_dimension, + default_model_type=default_model_type, + ) + + embedding_model_list_response.additional_properties = d + return embedding_model_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/embedding_model_response.py b/seclai/_generated/models/embedding_model_response.py new file mode 100644 index 0000000..db09fb1 --- /dev/null +++ b/seclai/_generated/models/embedding_model_response.py @@ -0,0 +1,340 @@ +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.embedding_modality_rate_response import EmbeddingModalityRateResponse + + +T = TypeVar("T", bound="EmbeddingModelResponse") + + +@_attrs_define +class EmbeddingModelResponse: + """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). This is the value to send as embedding_model when + creating a source. + description (None | str | Unset): Model description + is_new (bool | Unset): Whether the model is newly released Default: False. + max_input_tokens (int | None | Unset): Max input tokens per request + mteb_retrieval_score (float | None | Unset): MTEB retrieval score + name (None | str | Unset): Human-readable model name + per_modality_rates (list[EmbeddingModalityRateResponse] | Unset): Non-text rates the vendor charges for this + embedder (image, video, audio). Empty for text-only embedders. + provider (None | str | Unset): Model provider identifier + speed (None | str | Unset): Model processing speed + supported_input_media (list[str] | None | Unset): Modalities the embedder accepts on input (short kinds like + text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its + embedder lists here. + supported_languages (list[str] | None | Unset): Supported languages + url (None | str | Unset): Model documentation URL + """ + + credits_: float + dimensions: list[int] + model_id: str + model_type: str + description: None | str | Unset = UNSET + is_new: bool | Unset = False + max_input_tokens: int | None | Unset = UNSET + mteb_retrieval_score: float | None | Unset = UNSET + name: None | str | Unset = UNSET + per_modality_rates: list[EmbeddingModalityRateResponse] | Unset = UNSET + provider: None | str | Unset = UNSET + speed: None | str | Unset = UNSET + supported_input_media: list[str] | None | Unset = UNSET + supported_languages: list[str] | None | 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 + + is_new = self.is_new + + max_input_tokens: int | None | Unset + if isinstance(self.max_input_tokens, Unset): + max_input_tokens = UNSET + else: + max_input_tokens = self.max_input_tokens + + 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 + + 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) + + provider: None | str | Unset + if isinstance(self.provider, Unset): + provider = UNSET + else: + provider = self.provider + + speed: None | str | Unset + if isinstance(self.speed, Unset): + speed = UNSET + else: + speed = self.speed + + 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 + + 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 is_new is not UNSET: + field_dict["is_new"] = is_new + if max_input_tokens is not UNSET: + field_dict["max_input_tokens"] = max_input_tokens + 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 per_modality_rates is not UNSET: + field_dict["per_modality_rates"] = per_modality_rates + if provider is not UNSET: + field_dict["provider"] = provider + if speed is not UNSET: + field_dict["speed"] = speed + 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 url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.embedding_modality_rate_response import ( + EmbeddingModalityRateResponse, + ) + + 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)) + + is_new = d.pop("is_new", UNSET) + + def _parse_max_input_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_input_tokens = _parse_max_input_tokens(d.pop("max_input_tokens", 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)) + + _per_modality_rates = d.pop("per_modality_rates", UNSET) + per_modality_rates: list[EmbeddingModalityRateResponse] | 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 = EmbeddingModalityRateResponse.from_dict( + per_modality_rates_item_data + ) + + per_modality_rates.append(per_modality_rates_item) + + def _parse_provider(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + provider = _parse_provider(d.pop("provider", UNSET)) + + def _parse_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_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_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_response = cls( + credits_=credits_, + dimensions=dimensions, + model_id=model_id, + model_type=model_type, + description=description, + is_new=is_new, + max_input_tokens=max_input_tokens, + mteb_retrieval_score=mteb_retrieval_score, + name=name, + per_modality_rates=per_modality_rates, + provider=provider, + speed=speed, + supported_input_media=supported_input_media, + supported_languages=supported_languages, + url=url, + ) + + embedding_model_response.additional_properties = d + return embedding_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/embedding_storage_credits_response.py b/seclai/_generated/models/embedding_storage_credits_response.py new file mode 100644 index 0000000..c5dd359 --- /dev/null +++ b/seclai/_generated/models/embedding_storage_credits_response.py @@ -0,0 +1,70 @@ +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="EmbeddingStorageCreditsResponse") + + +@_attrs_define +class EmbeddingStorageCreditsResponse: + """Monthly storage credits per stored record at a dimension count. + + 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_response = cls( + credits_=credits_, + dimensions=dimensions, + ) + + embedding_storage_credits_response.additional_properties = d + return embedding_storage_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/experiment_detail_response.py b/seclai/_generated/models/experiment_detail_response.py index 61004e5..b7de7e3 100644 --- a/seclai/_generated/models/experiment_detail_response.py +++ b/seclai/_generated/models/experiment_detail_response.py @@ -6,7 +6,12 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + if TYPE_CHECKING: + from ..models.experiment_detail_response_effort import ( + ExperimentDetailResponseEffort, + ) from ..models.experiment_detail_response_result_data_type_0 import ( ExperimentDetailResponseResultDataType0, ) @@ -38,6 +43,7 @@ class ExperimentDetailResponse: started_at (None | str): status (str): system_prompt (str): + effort (ExperimentDetailResponseEffort | Unset): The reasoning effort each model was run at, by model ID. """ completed_at: None | str @@ -59,6 +65,7 @@ class ExperimentDetailResponse: started_at: None | str status: str system_prompt: str + effort: ExperimentDetailResponseEffort | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -117,6 +124,10 @@ def to_dict(self) -> dict[str, Any]: system_prompt = self.system_prompt + effort: dict[str, Any] | Unset = UNSET + if not isinstance(self.effort, Unset): + effort = self.effort.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -142,11 +153,16 @@ def to_dict(self) -> dict[str, Any]: "system_prompt": system_prompt, } ) + if effort is not UNSET: + field_dict["effort"] = effort return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.experiment_detail_response_effort import ( + ExperimentDetailResponseEffort, + ) from ..models.experiment_detail_response_result_data_type_0 import ( ExperimentDetailResponseResultDataType0, ) @@ -255,6 +271,13 @@ def _parse_started_at(data: object) -> None | str: system_prompt = d.pop("system_prompt") + _effort = d.pop("effort", UNSET) + effort: ExperimentDetailResponseEffort | Unset + if isinstance(_effort, Unset): + effort = UNSET + else: + effort = ExperimentDetailResponseEffort.from_dict(_effort) + experiment_detail_response = cls( completed_at=completed_at, created_at=created_at, @@ -275,6 +298,7 @@ def _parse_started_at(data: object) -> None | str: started_at=started_at, status=status, system_prompt=system_prompt, + effort=effort, ) experiment_detail_response.additional_properties = d diff --git a/seclai/_generated/models/experiment_detail_response_effort.py b/seclai/_generated/models/experiment_detail_response_effort.py new file mode 100644 index 0000000..a720193 --- /dev/null +++ b/seclai/_generated/models/experiment_detail_response_effort.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="ExperimentDetailResponseEffort") + + +@_attrs_define +class ExperimentDetailResponseEffort: + """The reasoning effort each model was run at, by model ID.""" + + 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) + experiment_detail_response_effort = cls() + + experiment_detail_response_effort.additional_properties = d + return experiment_detail_response_effort + + @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/file_upload_response.py b/seclai/_generated/models/file_upload_response.py index 3d58165..8734a88 100644 --- a/seclai/_generated/models/file_upload_response.py +++ b/seclai/_generated/models/file_upload_response.py @@ -6,6 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="FileUploadResponse") @@ -14,16 +16,22 @@ class FileUploadResponse: """Response model for content file replacement upload. Attributes: - content_version_id (None | str): ID of the content version being replaced + content_version_id (None | str): ID of the newly created content version. A replacement creates a new version + rather than overwriting the previous one. filename (str): Original filename - source_connection_content_version_id (None | str): ID of the source connection content version - status (str): Processing status + source_connection_content_version_id (None | str): ID of the source connection content version. Unchanged by a + replacement, so it stays a stable handle for the content. + status (str): Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of + another item. + embedder_warning (None | str | Unset): Set when the file's type is not embedded directly on this source, so + indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED. """ content_version_id: None | str filename: str source_connection_content_version_id: None | str status: str + embedder_warning: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,6 +45,12 @@ def to_dict(self) -> dict[str, Any]: status = self.status + embedder_warning: None | str | Unset + if isinstance(self.embedder_warning, Unset): + embedder_warning = UNSET + else: + embedder_warning = self.embedder_warning + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -47,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: "status": status, } ) + if embedder_warning is not UNSET: + field_dict["embedder_warning"] = embedder_warning return field_dict @@ -76,11 +92,21 @@ def _parse_source_connection_content_version_id(data: object) -> None | str: status = d.pop("status") + def _parse_embedder_warning(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + embedder_warning = _parse_embedder_warning(d.pop("embedder_warning", UNSET)) + file_upload_response = cls( content_version_id=content_version_id, filename=filename, source_connection_content_version_id=source_connection_content_version_id, status=status, + embedder_warning=embedder_warning, ) file_upload_response.additional_properties = d diff --git a/seclai/_generated/models/knowledge_base.py b/seclai/_generated/models/knowledge_base.py index a2dfc00..385544b 100644 --- a/seclai/_generated/models/knowledge_base.py +++ b/seclai/_generated/models/knowledge_base.py @@ -24,9 +24,9 @@ class KnowledgeBase: 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. + default_score_threshold (float | None | Unset): Editor default for a new retrieval step's Minimum Rerank Score. + default_top_k (int | None | Unset): Editor default for a new retrieval step's Top K. + default_top_n (int | None | Unset): Editor default for a new retrieval step's Top N. 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. diff --git a/seclai/_generated/models/memory_bank.py b/seclai/_generated/models/memory_bank.py index e420e28..56b98f3 100644 --- a/seclai/_generated/models/memory_bank.py +++ b/seclai/_generated/models/memory_bank.py @@ -29,14 +29,21 @@ class MemoryBank: 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_age_days (int | None | Unset): DEPRECATED and no longer applied. Age now belongs solely to retention_days, + which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai- + Version 2026-08-03 or later; older clients keep reading whatever value was stored. 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). + strip_quoted_reply_chains (bool | Unset): Conversation banks only. When true, a conversation turn written to + this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) + turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped + (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a + one-character change inside a link, address or amount, unless the change is only to that edge punctuation. + Default: False. """ created_at: str @@ -56,6 +63,7 @@ class MemoryBank: max_turns: int | None | Unset = UNSET retention_days: int | None | Unset = UNSET source_connection_id: None | str | Unset = UNSET + strip_quoted_reply_chains: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -137,6 +145,8 @@ def to_dict(self) -> dict[str, Any]: else: source_connection_id = self.source_connection_id + strip_quoted_reply_chains = self.strip_quoted_reply_chains + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -171,6 +181,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["retention_days"] = retention_days if source_connection_id is not UNSET: field_dict["source_connection_id"] = source_connection_id + if strip_quoted_reply_chains is not UNSET: + field_dict["strip_quoted_reply_chains"] = strip_quoted_reply_chains return field_dict @@ -290,6 +302,8 @@ def _parse_source_connection_id(data: object) -> None | str | Unset: d.pop("source_connection_id", UNSET) ) + strip_quoted_reply_chains = d.pop("strip_quoted_reply_chains", UNSET) + memory_bank = cls( created_at=created_at, id=id, @@ -308,6 +322,7 @@ def _parse_source_connection_id(data: object) -> None | str | Unset: max_turns=max_turns, retention_days=retention_days, source_connection_id=source_connection_id, + strip_quoted_reply_chains=strip_quoted_reply_chains, ) memory_bank.additional_properties = d diff --git a/seclai/_generated/models/memory_bank_config_response.py b/seclai/_generated/models/memory_bank_config_response.py index 246cdfa..c52b8a3 100644 --- a/seclai/_generated/models/memory_bank_config_response.py +++ b/seclai/_generated/models/memory_bank_config_response.py @@ -21,7 +21,8 @@ class MemoryBankConfigResponse: 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_age_days (int | None | Unset): Always null. Age-based compaction is retired — the assistant never suggests + it. Kept so an SDK generated before the change still validates this response. 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. diff --git a/seclai/_generated/models/model_recommendation_response.py b/seclai/_generated/models/model_recommendation_response.py index 0334ec7..dae2825 100644 --- a/seclai/_generated/models/model_recommendation_response.py +++ b/seclai/_generated/models/model_recommendation_response.py @@ -1,13 +1,17 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.effort_options_response import EffortOptionsResponse + + T = TypeVar("T", bound="ModelRecommendationResponse") @@ -30,6 +34,7 @@ class ModelRecommendationResponse: supports_thinking (bool): supports_tool_use (bool): deprecated_at (None | str | Unset): + effort_options (EffortOptionsResponse | None | Unset): family (None | str | Unset): family_generation (float | None | Unset): released_at (None | str | Unset): @@ -51,6 +56,7 @@ class ModelRecommendationResponse: supports_thinking: bool supports_tool_use: bool deprecated_at: None | str | Unset = UNSET + effort_options: EffortOptionsResponse | None | Unset = UNSET family: None | str | Unset = UNSET family_generation: float | None | Unset = UNSET released_at: None | str | Unset = UNSET @@ -58,6 +64,8 @@ class ModelRecommendationResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.effort_options_response import EffortOptionsResponse + description = self.description id = self.id @@ -92,6 +100,14 @@ def to_dict(self) -> dict[str, Any]: else: deprecated_at = self.deprecated_at + effort_options: dict[str, Any] | None | Unset + if isinstance(self.effort_options, Unset): + effort_options = UNSET + elif isinstance(self.effort_options, EffortOptionsResponse): + effort_options = self.effort_options.to_dict() + else: + effort_options = self.effort_options + family: None | str | Unset if isinstance(self.family, Unset): family = UNSET @@ -138,6 +154,8 @@ def to_dict(self) -> dict[str, Any]: ) if deprecated_at is not UNSET: field_dict["deprecated_at"] = deprecated_at + if effort_options is not UNSET: + field_dict["effort_options"] = effort_options if family is not UNSET: field_dict["family"] = family if family_generation is not UNSET: @@ -151,6 +169,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.effort_options_response import EffortOptionsResponse + d = dict(src_dict) description = d.pop("description") @@ -189,6 +209,23 @@ def _parse_deprecated_at(data: object) -> None | str | Unset: deprecated_at = _parse_deprecated_at(d.pop("deprecated_at", UNSET)) + def _parse_effort_options(data: object) -> EffortOptionsResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + effort_options_type_0 = EffortOptionsResponse.from_dict(data) + + return effort_options_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EffortOptionsResponse | None | Unset, data) + + effort_options = _parse_effort_options(d.pop("effort_options", UNSET)) + def _parse_family(data: object) -> None | str | Unset: if data is None: return data @@ -241,6 +278,7 @@ def _parse_sunset_at(data: object) -> None | str | Unset: supports_thinking=supports_thinking, supports_tool_use=supports_tool_use, deprecated_at=deprecated_at, + effort_options=effort_options, family=family, family_generation=family_generation, released_at=released_at, diff --git a/seclai/_generated/models/playground_create_request.py b/seclai/_generated/models/playground_create_request.py index f94c14e..e3c7437 100644 --- a/seclai/_generated/models/playground_create_request.py +++ b/seclai/_generated/models/playground_create_request.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,6 +14,12 @@ ) from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.playground_create_request_effort_type_0 import ( + PlaygroundCreateRequestEffortType0, + ) + + T = TypeVar("T", bound="PlaygroundCreateRequest") @@ -24,6 +30,8 @@ class PlaygroundCreateRequest: Attributes: model_ids (list[str]): Selected model IDs (1-10). prompt (str): Prompt text for the experiment. + effort (None | PlaygroundCreateRequestEffortType0 | Unset): Reasoning effort per model id, each one of that + model's `effort_options` values. Not combinable with `json_template`. evaluation_complexity (PlaygroundCreateRequestEvaluationComplexity | Unset): simple, medium, or complex Default: PlaygroundCreateRequestEvaluationComplexity.MEDIUM. evaluation_mode (PlaygroundCreateRequestEvaluationMode | Unset): manual or prompt Default: @@ -38,6 +46,7 @@ class PlaygroundCreateRequest: model_ids: list[str] prompt: str + effort: None | PlaygroundCreateRequestEffortType0 | Unset = UNSET evaluation_complexity: PlaygroundCreateRequestEvaluationComplexity | Unset = ( PlaygroundCreateRequestEvaluationComplexity.MEDIUM ) @@ -52,10 +61,22 @@ class PlaygroundCreateRequest: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.playground_create_request_effort_type_0 import ( + PlaygroundCreateRequestEffortType0, + ) + model_ids = self.model_ids prompt = self.prompt + effort: dict[str, Any] | None | Unset + if isinstance(self.effort, Unset): + effort = UNSET + elif isinstance(self.effort, PlaygroundCreateRequestEffortType0): + effort = self.effort.to_dict() + else: + effort = self.effort + evaluation_complexity: str | Unset = UNSET if not isinstance(self.evaluation_complexity, Unset): evaluation_complexity = self.evaluation_complexity.value @@ -94,6 +115,8 @@ def to_dict(self) -> dict[str, Any]: "prompt": prompt, } ) + if effort is not UNSET: + field_dict["effort"] = effort if evaluation_complexity is not UNSET: field_dict["evaluation_complexity"] = evaluation_complexity if evaluation_mode is not UNSET: @@ -115,11 +138,34 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.playground_create_request_effort_type_0 import ( + PlaygroundCreateRequestEffortType0, + ) + d = dict(src_dict) model_ids = cast(list[str], d.pop("model_ids")) prompt = d.pop("prompt") + def _parse_effort( + data: object, + ) -> None | PlaygroundCreateRequestEffortType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + effort_type_0 = PlaygroundCreateRequestEffortType0.from_dict(data) + + return effort_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PlaygroundCreateRequestEffortType0 | Unset, data) + + effort = _parse_effort(d.pop("effort", UNSET)) + _evaluation_complexity = d.pop("evaluation_complexity", UNSET) evaluation_complexity: PlaygroundCreateRequestEvaluationComplexity | Unset if isinstance(_evaluation_complexity, Unset): @@ -176,6 +222,7 @@ def _parse_selected_step_output(data: object) -> None | str | Unset: playground_create_request = cls( model_ids=model_ids, prompt=prompt, + effort=effort, evaluation_complexity=evaluation_complexity, evaluation_mode=evaluation_mode, evaluator_model_id=evaluator_model_id, diff --git a/seclai/_generated/models/playground_create_request_effort_type_0.py b/seclai/_generated/models/playground_create_request_effort_type_0.py new file mode 100644 index 0000000..a070572 --- /dev/null +++ b/seclai/_generated/models/playground_create_request_effort_type_0.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="PlaygroundCreateRequestEffortType0") + + +@_attrs_define +class PlaygroundCreateRequestEffortType0: + """ """ + + 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) + playground_create_request_effort_type_0 = cls() + + playground_create_request_effort_type_0.additional_properties = d + return playground_create_request_effort_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/prompt_model_response.py b/seclai/_generated/models/prompt_model_response.py index 62954d0..5ae8d7b 100644 --- a/seclai/_generated/models/prompt_model_response.py +++ b/seclai/_generated/models/prompt_model_response.py @@ -11,7 +11,11 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.effort_options_response import EffortOptionsResponse from ..models.modality_rate_response import ModalityRateResponse + from ..models.prompt_model_response_generation_credits_per_variant_type_0 import ( + PromptModelResponseGenerationCreditsPerVariantType0, + ) from ..models.prompt_model_response_generation_params_type_0 import ( PromptModelResponseGenerationParamsType0, ) @@ -40,16 +44,35 @@ class PromptModelResponse: model_id (str): name (str): provider (str): + chat_capable (bool | Unset): Whether this model can serve a chat request (`prompt_call`, `extract_data`). True + for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false + for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. + Authoritative: consumers must read this rather than inferring it from `generation_params` or + `supported_output_media`, because the answer also depends on which inference interface serves the model — + something no response field exposes. Default: True. deprecated_at (datetime.datetime | None | Unset): + effort_options (EffortOptionsResponse | None | Unset): The reasoning-effort values a prompt_call or extract_data + step may set as `effort` with this model. Null when the model takes none. 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. + token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for models with + no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model + that also serves the chat path is billed per token there instead, using the input/output token rates on this + same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and + this is the **highest** of them — read `generation_credits_per_variant` for the real spread rather than + presenting this as the price. + generation_credits_per_variant (None | PromptModelResponseGenerationCreditsPerVariantType0 | Unset): Per-unit + credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, + '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it + exactly. 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 models. See schemas.generation_params. A present descriptor does NOT imply the model is generation- + only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to + tell whether a model with a descriptor can also be used as a chat model — do not branch on this field being non- + null alone, and do not re-derive the answer from `supported_output_media`. 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 @@ -57,9 +80,14 @@ class PromptModelResponse: 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_1h_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to a + 1-hour prompt cache. + input_30m_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to + a 30-minute prompt cache. + input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to a + 5-minute prompt cache. + input_cache_hit_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens read from a + prompt cache. input_credits_per_1000_tokens (float | None | Unset): is_new (bool | Unset): Default: False. last_used (bool | Unset): Default: False. @@ -99,14 +127,20 @@ class PromptModelResponse: model_id: str name: str provider: str + chat_capable: bool | Unset = True deprecated_at: datetime.datetime | None | Unset = UNSET + effort_options: EffortOptionsResponse | None | Unset = UNSET family: None | str | Unset = UNSET family_generation: float | None | Unset = UNSET generation_credits_per_unit: float | None | Unset = UNSET + generation_credits_per_variant: ( + None | PromptModelResponseGenerationCreditsPerVariantType0 | 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_30m_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 @@ -137,6 +171,10 @@ class PromptModelResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.effort_options_response import EffortOptionsResponse + from ..models.prompt_model_response_generation_credits_per_variant_type_0 import ( + PromptModelResponseGenerationCreditsPerVariantType0, + ) from ..models.prompt_model_response_generation_params_type_0 import ( PromptModelResponseGenerationParamsType0, ) @@ -164,6 +202,8 @@ def to_dict(self) -> dict[str, Any]: provider = self.provider + chat_capable = self.chat_capable + deprecated_at: None | str | Unset if isinstance(self.deprecated_at, Unset): deprecated_at = UNSET @@ -172,6 +212,14 @@ def to_dict(self) -> dict[str, Any]: else: deprecated_at = self.deprecated_at + effort_options: dict[str, Any] | None | Unset + if isinstance(self.effort_options, Unset): + effort_options = UNSET + elif isinstance(self.effort_options, EffortOptionsResponse): + effort_options = self.effort_options.to_dict() + else: + effort_options = self.effort_options + family: None | str | Unset if isinstance(self.family, Unset): family = UNSET @@ -190,6 +238,19 @@ def to_dict(self) -> dict[str, Any]: else: generation_credits_per_unit = self.generation_credits_per_unit + generation_credits_per_variant: dict[str, Any] | None | Unset + if isinstance(self.generation_credits_per_variant, Unset): + generation_credits_per_variant = UNSET + elif isinstance( + self.generation_credits_per_variant, + PromptModelResponseGenerationCreditsPerVariantType0, + ): + generation_credits_per_variant = ( + self.generation_credits_per_variant.to_dict() + ) + else: + generation_credits_per_variant = self.generation_credits_per_variant + generation_params: dict[str, Any] | None | Unset if isinstance(self.generation_params, Unset): generation_params = UNSET @@ -222,6 +283,14 @@ def to_dict(self) -> dict[str, Any]: self.input_1h_cache_write_credits_per_1000_tokens ) + input_30m_cache_write_credits_per_1000_tokens: float | None | Unset + if isinstance(self.input_30m_cache_write_credits_per_1000_tokens, Unset): + input_30m_cache_write_credits_per_1000_tokens = UNSET + else: + input_30m_cache_write_credits_per_1000_tokens = ( + self.input_30m_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 @@ -402,14 +471,22 @@ def to_dict(self) -> dict[str, Any]: "provider": provider, } ) + if chat_capable is not UNSET: + field_dict["chat_capable"] = chat_capable if deprecated_at is not UNSET: field_dict["deprecated_at"] = deprecated_at + if effort_options is not UNSET: + field_dict["effort_options"] = effort_options 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_credits_per_variant is not UNSET: + field_dict["generation_credits_per_variant"] = ( + generation_credits_per_variant + ) if generation_params is not UNSET: field_dict["generation_params"] = generation_params if generation_unit_label is not UNSET: @@ -422,6 +499,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( input_1h_cache_write_credits_per_1000_tokens ) + if input_30m_cache_write_credits_per_1000_tokens is not UNSET: + field_dict["input_30m_cache_write_credits_per_1000_tokens"] = ( + input_30m_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 @@ -487,7 +568,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.effort_options_response import EffortOptionsResponse from ..models.modality_rate_response import ModalityRateResponse + from ..models.prompt_model_response_generation_credits_per_variant_type_0 import ( + PromptModelResponseGenerationCreditsPerVariantType0, + ) from ..models.prompt_model_response_generation_params_type_0 import ( PromptModelResponseGenerationParamsType0, ) @@ -518,6 +603,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: provider = d.pop("provider") + chat_capable = d.pop("chat_capable", UNSET) + def _parse_deprecated_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data @@ -535,6 +622,23 @@ def _parse_deprecated_at(data: object) -> datetime.datetime | None | Unset: deprecated_at = _parse_deprecated_at(d.pop("deprecated_at", UNSET)) + def _parse_effort_options(data: object) -> EffortOptionsResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + effort_options_type_0 = EffortOptionsResponse.from_dict(data) + + return effort_options_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EffortOptionsResponse | None | Unset, data) + + effort_options = _parse_effort_options(d.pop("effort_options", UNSET)) + def _parse_family(data: object) -> None | str | Unset: if data is None: return data @@ -564,6 +668,31 @@ def _parse_generation_credits_per_unit(data: object) -> float | None | Unset: d.pop("generation_credits_per_unit", UNSET) ) + def _parse_generation_credits_per_variant( + data: object, + ) -> None | PromptModelResponseGenerationCreditsPerVariantType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + generation_credits_per_variant_type_0 = ( + PromptModelResponseGenerationCreditsPerVariantType0.from_dict(data) + ) + + return generation_credits_per_variant_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + None | PromptModelResponseGenerationCreditsPerVariantType0 | Unset, data + ) + + generation_credits_per_variant = _parse_generation_credits_per_variant( + d.pop("generation_credits_per_variant", UNSET) + ) + def _parse_generation_params( data: object, ) -> None | PromptModelResponseGenerationParamsType0 | Unset: @@ -626,6 +755,21 @@ def _parse_input_1h_cache_write_credits_per_1000_tokens( ) ) + def _parse_input_30m_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_30m_cache_write_credits_per_1000_tokens = ( + _parse_input_30m_cache_write_credits_per_1000_tokens( + d.pop("input_30m_cache_write_credits_per_1000_tokens", UNSET) + ) + ) + def _parse_input_5m_cache_write_credits_per_1000_tokens( data: object, ) -> float | None | Unset: @@ -944,14 +1088,18 @@ def _parse_variants( model_id=model_id, name=name, provider=provider, + chat_capable=chat_capable, deprecated_at=deprecated_at, + effort_options=effort_options, family=family, family_generation=family_generation, generation_credits_per_unit=generation_credits_per_unit, + generation_credits_per_variant=generation_credits_per_variant, 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_30m_cache_write_credits_per_1000_tokens=input_30m_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, diff --git a/seclai/_generated/models/prompt_model_response_generation_credits_per_variant_type_0.py b/seclai/_generated/models/prompt_model_response_generation_credits_per_variant_type_0.py new file mode 100644 index 0000000..407af96 --- /dev/null +++ b/seclai/_generated/models/prompt_model_response_generation_credits_per_variant_type_0.py @@ -0,0 +1,48 @@ +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="PromptModelResponseGenerationCreditsPerVariantType0") + + +@_attrs_define +class PromptModelResponseGenerationCreditsPerVariantType0: + """ """ + + additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + prompt_model_response_generation_credits_per_variant_type_0 = cls() + + prompt_model_response_generation_credits_per_variant_type_0.additional_properties = ( + d + ) + return prompt_model_response_generation_credits_per_variant_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> float: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: float) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/seclai/_generated/models/reranker_model_list_response.py b/seclai/_generated/models/reranker_model_list_response.py new file mode 100644 index 0000000..bc0e960 --- /dev/null +++ b/seclai/_generated/models/reranker_model_list_response.py @@ -0,0 +1,92 @@ +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.reranker_model_response import RerankerModelResponse + + +T = TypeVar("T", bound="RerankerModelListResponse") + + +@_attrs_define +class RerankerModelListResponse: + """Legacy (header-less) response shape for the reranker catalog. + + Attributes: + default_model_type (str): Reranker used when a knowledge base does not choose one + models (list[RerankerModelResponse]): Available reranker models + search_processing_credits (float): Credits charged for processing a search request + """ + + default_model_type: str + models: list[RerankerModelResponse] + 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 + + 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, + "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.reranker_model_response import RerankerModelResponse + + d = dict(src_dict) + default_model_type = d.pop("default_model_type") + + models = [] + _models = d.pop("models") + for models_item_data in _models: + models_item = RerankerModelResponse.from_dict(models_item_data) + + models.append(models_item) + + search_processing_credits = d.pop("search_processing_credits") + + reranker_model_list_response = cls( + default_model_type=default_model_type, + models=models, + search_processing_credits=search_processing_credits, + ) + + reranker_model_list_response.additional_properties = d + return reranker_model_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/reranker_model_response.py b/seclai/_generated/models/reranker_model_response.py new file mode 100644 index 0000000..b5a0a87 --- /dev/null +++ b/seclai/_generated/models/reranker_model_response.py @@ -0,0 +1,211 @@ +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="RerankerModelResponse") + + +@_attrs_define +class RerankerModelResponse: + """Information about a reranker model. + + Attributes: + credits_per_action (float): Credits charged per rerank action + is_default (bool): Whether this is the platform default reranker + model_type (str): Full model type identifier. This is the value to send as reranker_model on a knowledge base; + send "none" or an empty string to disable reranking. + name (str): Human-readable model name + description (None | str | Unset): Model description + is_new (bool | Unset): Whether the model is newly released Default: False. + max_input_tokens (int | None | Unset): Max input tokens per request + provider (None | str | Unset): Model provider identifier + supported_languages (list[str] | None | Unset): Supported languages + url (None | str | Unset): Model documentation URL + """ + + credits_per_action: float + is_default: bool + model_type: str + name: str + description: None | str | Unset = UNSET + is_new: bool | Unset = False + max_input_tokens: int | None | Unset = UNSET + provider: None | str | Unset = UNSET + supported_languages: list[str] | None | 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 + + is_new = self.is_new + + max_input_tokens: int | None | Unset + if isinstance(self.max_input_tokens, Unset): + max_input_tokens = UNSET + else: + max_input_tokens = self.max_input_tokens + + provider: None | str | Unset + if isinstance(self.provider, Unset): + provider = UNSET + else: + provider = self.provider + + 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 + + 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 is_new is not UNSET: + field_dict["is_new"] = is_new + if max_input_tokens is not UNSET: + field_dict["max_input_tokens"] = max_input_tokens + if provider is not UNSET: + field_dict["provider"] = provider + if supported_languages is not UNSET: + field_dict["supported_languages"] = supported_languages + 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)) + + is_new = d.pop("is_new", UNSET) + + def _parse_max_input_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_input_tokens = _parse_max_input_tokens(d.pop("max_input_tokens", UNSET)) + + def _parse_provider(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + provider = _parse_provider(d.pop("provider", UNSET)) + + def _parse_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_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_response = cls( + credits_per_action=credits_per_action, + is_default=is_default, + model_type=model_type, + name=name, + description=description, + is_new=is_new, + max_input_tokens=max_input_tokens, + provider=provider, + supported_languages=supported_languages, + url=url, + ) + + reranker_model_response.additional_properties = d + return reranker_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/service_unavailable_error.py b/seclai/_generated/models/service_unavailable_error.py new file mode 100644 index 0000000..f8f5909 --- /dev/null +++ b/seclai/_generated/models/service_unavailable_error.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.service_unavailable_error_error import ServiceUnavailableErrorError + + +T = TypeVar("T", bound="ServiceUnavailableError") + + +@_attrs_define +class ServiceUnavailableError: + """ + Attributes: + error (ServiceUnavailableErrorError): + """ + + error: ServiceUnavailableErrorError + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_unavailable_error_error import ( + ServiceUnavailableErrorError, + ) + + d = dict(src_dict) + error = ServiceUnavailableErrorError.from_dict(d.pop("error")) + + service_unavailable_error = cls( + error=error, + ) + + service_unavailable_error.additional_properties = d + return service_unavailable_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/service_unavailable_error_error.py b/seclai/_generated/models/service_unavailable_error_error.py new file mode 100644 index 0000000..c968e2f --- /dev/null +++ b/seclai/_generated/models/service_unavailable_error_error.py @@ -0,0 +1,73 @@ +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.service_unavailable_error_error_code import ( + ServiceUnavailableErrorErrorCode, +) + +T = TypeVar("T", bound="ServiceUnavailableErrorError") + + +@_attrs_define +class ServiceUnavailableErrorError: + """ + Attributes: + code (ServiceUnavailableErrorErrorCode): + message (str): + """ + + code: ServiceUnavailableErrorErrorCode + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + code = self.code.value + + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "code": code, + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = ServiceUnavailableErrorErrorCode(d.pop("code")) + + message = d.pop("message") + + service_unavailable_error_error = cls( + code=code, + message=message, + ) + + service_unavailable_error_error.additional_properties = d + return service_unavailable_error_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/service_unavailable_error_error_code.py b/seclai/_generated/models/service_unavailable_error_error_code.py new file mode 100644 index 0000000..1759fa0 --- /dev/null +++ b/seclai/_generated/models/service_unavailable_error_error_code.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ServiceUnavailableErrorErrorCode(str, Enum): + DATABASE_UNAVAILABLE = "database_unavailable" + VECTOR_STORE_UNAVAILABLE = "vector_store_unavailable" + + def __str__(self) -> str: + return str(self.value) diff --git a/seclai/_generated/models/set_email_trigger_config_request.py b/seclai/_generated/models/set_email_trigger_config_request.py index ec192a6..056b04c 100644 --- a/seclai/_generated/models/set_email_trigger_config_request.py +++ b/seclai/_generated/models/set_email_trigger_config_request.py @@ -19,9 +19,10 @@ class SetEmailTriggerConfigRequest: ``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. + alias (None | str | Unset): Custom alias, unique per account, answering as + `.@agent.seclai.com` and as `@` on each verified account email domain + (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 diff --git a/seclai/_generated/models/source_content_status_list_response.py b/seclai/_generated/models/source_content_status_list_response.py new file mode 100644 index 0000000..a2bc03f --- /dev/null +++ b/seclai/_generated/models/source_content_status_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.pagination_response import PaginationResponse + from ..models.source_content_status_response import SourceContentStatusResponse + + +T = TypeVar("T", bound="SourceContentStatusListResponse") + + +@_attrs_define +class SourceContentStatusListResponse: + """Response model for a paginated per-item indexing status list. + + Attributes: + data (list[SourceContentStatusResponse]): + pagination (PaginationResponse): Pagination information. + """ + + data: list[SourceContentStatusResponse] + 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_content_status_response import SourceContentStatusResponse + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SourceContentStatusResponse.from_dict(data_item_data) + + data.append(data_item) + + pagination = PaginationResponse.from_dict(d.pop("pagination")) + + source_content_status_list_response = cls( + data=data, + pagination=pagination, + ) + + source_content_status_list_response.additional_properties = d + return source_content_status_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_content_status_response.py b/seclai/_generated/models/source_content_status_response.py new file mode 100644 index 0000000..3e8033d --- /dev/null +++ b/seclai/_generated/models/source_content_status_response.py @@ -0,0 +1,301 @@ +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="SourceContentStatusResponse") + + +@_attrs_define +class SourceContentStatusResponse: + """Response model for one content item's indexing status. + + Attributes: + content_status (str): Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or + failed. + content_token_count (int | None): Extracted token count. + content_type (str): Content type group: text, audio, video, image, or document. + content_url (None | str): Internal URL identifying the item. Uploaded files use a `file-upload://` URL. + content_version_id (str): ID of the content version. This is the `content_version_id` returned by the upload + endpoints, so it is what you match an upload against. + content_word_count (int | None): Extracted word count. + error (None | str): Why the item failed, when `content_status` is `failed`. + indexed_at (None | str): Timestamp when the item finished indexing and became retrievable. `null` until then. + mime_type (None | str): MIME type the item was ingested as, when known. + published_at (None | str): Publication timestamp of the item, when known. + pulled_at (str): Timestamp when the item was uploaded or pulled. + source_connection_content_version_id (None | str): ID to pass to `GET /contents/{id}`. `null` until the item has + finished indexing — an item that is still processing, or that failed, has no retrievable content and keeps this + `null`. + title (None | str): Title of the content item. + awaiting_reindex (bool | Unset): True when the item is linked and reports completed but its content is not yet + embedded under the index the source connection currently uses, because it still sits under the index that + connection used before an embedding migration switched it. Anything ingested while a migration ran can land in + this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can + still return it, so the item may appear in results while its body is unsearchable. It clears on its own — a + reconciliation pass re-embeds the item under the current index, typically within minutes of the migration + finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one + 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. + 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. + """ + + content_status: str + content_token_count: int | None + content_type: str + content_url: None | str + content_version_id: str + content_word_count: int | None + error: None | str + indexed_at: None | str + mime_type: None | str + published_at: None | str + pulled_at: str + source_connection_content_version_id: None | str + title: None | str + awaiting_reindex: bool | Unset = False + extracted_media_capped: bool | Unset = False + extracted_media_count: int | None | Unset = UNSET + extracted_media_limit: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + content_status = self.content_status + + content_token_count: int | None + content_token_count = self.content_token_count + + content_type = self.content_type + + content_url: None | str + content_url = self.content_url + + content_version_id = self.content_version_id + + content_word_count: int | None + content_word_count = self.content_word_count + + error: None | str + error = self.error + + indexed_at: None | str + indexed_at = self.indexed_at + + mime_type: None | str + mime_type = self.mime_type + + published_at: None | str + published_at = self.published_at + + pulled_at = self.pulled_at + + source_connection_content_version_id: None | str + source_connection_content_version_id = self.source_connection_content_version_id + + title: None | str + title = self.title + + awaiting_reindex = self.awaiting_reindex + + extracted_media_capped = self.extracted_media_capped + + extracted_media_count: int | None | Unset + if isinstance(self.extracted_media_count, Unset): + extracted_media_count = UNSET + else: + extracted_media_count = self.extracted_media_count + + extracted_media_limit: int | None | Unset + if isinstance(self.extracted_media_limit, Unset): + extracted_media_limit = UNSET + else: + extracted_media_limit = self.extracted_media_limit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "content_status": content_status, + "content_token_count": content_token_count, + "content_type": content_type, + "content_url": content_url, + "content_version_id": content_version_id, + "content_word_count": content_word_count, + "error": error, + "indexed_at": indexed_at, + "mime_type": mime_type, + "published_at": published_at, + "pulled_at": pulled_at, + "source_connection_content_version_id": source_connection_content_version_id, + "title": title, + } + ) + if awaiting_reindex is not UNSET: + field_dict["awaiting_reindex"] = awaiting_reindex + if extracted_media_capped is not UNSET: + field_dict["extracted_media_capped"] = extracted_media_capped + if extracted_media_count is not UNSET: + field_dict["extracted_media_count"] = extracted_media_count + if extracted_media_limit is not UNSET: + field_dict["extracted_media_limit"] = extracted_media_limit + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + content_status = d.pop("content_status") + + def _parse_content_token_count(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + content_token_count = _parse_content_token_count(d.pop("content_token_count")) + + content_type = d.pop("content_type") + + def _parse_content_url(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + content_url = _parse_content_url(d.pop("content_url")) + + content_version_id = d.pop("content_version_id") + + 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_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + error = _parse_error(d.pop("error")) + + def _parse_indexed_at(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + indexed_at = _parse_indexed_at(d.pop("indexed_at")) + + def _parse_mime_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mime_type = _parse_mime_type(d.pop("mime_type")) + + 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") + + 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") + ) + ) + + def _parse_title(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + title = _parse_title(d.pop("title")) + + awaiting_reindex = d.pop("awaiting_reindex", UNSET) + + extracted_media_capped = d.pop("extracted_media_capped", UNSET) + + def _parse_extracted_media_count(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + extracted_media_count = _parse_extracted_media_count( + d.pop("extracted_media_count", UNSET) + ) + + def _parse_extracted_media_limit(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + extracted_media_limit = _parse_extracted_media_limit( + d.pop("extracted_media_limit", UNSET) + ) + + source_content_status_response = cls( + content_status=content_status, + content_token_count=content_token_count, + content_type=content_type, + content_url=content_url, + content_version_id=content_version_id, + content_word_count=content_word_count, + error=error, + indexed_at=indexed_at, + mime_type=mime_type, + published_at=published_at, + pulled_at=pulled_at, + source_connection_content_version_id=source_connection_content_version_id, + title=title, + awaiting_reindex=awaiting_reindex, + extracted_media_capped=extracted_media_capped, + extracted_media_count=extracted_media_count, + extracted_media_limit=extracted_media_limit, + ) + + source_content_status_response.additional_properties = d + return source_content_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/start_source_embedding_migration_request.py b/seclai/_generated/models/start_source_embedding_migration_request.py index 74eb819..9cd57e3 100644 --- a/seclai/_generated/models/start_source_embedding_migration_request.py +++ b/seclai/_generated/models/start_source_embedding_migration_request.py @@ -17,7 +17,8 @@ class StartSourceEmbeddingMigrationRequest: Attributes: target_dimensions (int): Target embedding dimensions - target_embedding_model (str): Target embedding model enum + target_embedding_model (str): Target embedding model — a `model_type` from `GET /models/embedders`, which also + reports the `dimensions` each embedder supports and the modalities it can index. 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 diff --git a/seclai/_generated/models/update_knowledge_base_body.py b/seclai/_generated/models/update_knowledge_base_body.py index 82f4048..286f50e 100644 --- a/seclai/_generated/models/update_knowledge_base_body.py +++ b/seclai/_generated/models/update_knowledge_base_body.py @@ -16,12 +16,16 @@ 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). + default_score_threshold (float | None | Unset): Prefilled into Minimum Rerank Score on a new retrieval step (-1 + to clear). + default_top_k (int | None | Unset): Prefilled into Top K on a new retrieval step (0 to clear). + default_top_n (int | None | Unset): Prefilled into Top N on a new retrieval step (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). + reranker_model (None | str | Unset): New reranker model — a `model_type` from `GET /models/rerankers`. Pass + "none" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the + current reranker in place — it does NOT turn it off. "" is accepted as a synonym for "none", but prefer "none": + an empty string does not survive every client's serialization. source_ids (list[str] | None | Unset): New list of source connection IDs. """ diff --git a/seclai/_generated/models/update_memory_bank_body.py b/seclai/_generated/models/update_memory_bank_body.py index 30fa14d..19bd30a 100644 --- a/seclai/_generated/models/update_memory_bank_body.py +++ b/seclai/_generated/models/update_memory_bank_body.py @@ -23,14 +23,21 @@ class UpdateMemoryBankBody: 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_age_days (int | None | Unset): DEPRECATED and no longer applied. Age now belongs solely to retention_days, + which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending + Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert + for older clients. 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). + strip_quoted_reply_chains (bool | None | Unset): Conversation banks only. When true, a conversation turn written + to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) + turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped + (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a + one-character change inside a link, address or amount, unless the change is only to that edge punctuation. """ compaction_prompt: None | str | Unset = UNSET @@ -40,6 +47,7 @@ class UpdateMemoryBankBody: max_turns: int | None | Unset = UNSET name: None | str | Unset = UNSET retention_days: int | None | Unset = UNSET + strip_quoted_reply_chains: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -85,6 +93,12 @@ def to_dict(self) -> dict[str, Any]: else: retention_days = self.retention_days + strip_quoted_reply_chains: bool | None | Unset + if isinstance(self.strip_quoted_reply_chains, Unset): + strip_quoted_reply_chains = UNSET + else: + strip_quoted_reply_chains = self.strip_quoted_reply_chains + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -102,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if retention_days is not UNSET: field_dict["retention_days"] = retention_days + if strip_quoted_reply_chains is not UNSET: + field_dict["strip_quoted_reply_chains"] = strip_quoted_reply_chains return field_dict @@ -172,6 +188,17 @@ def _parse_retention_days(data: object) -> int | None | Unset: retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) + def _parse_strip_quoted_reply_chains(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + strip_quoted_reply_chains = _parse_strip_quoted_reply_chains( + d.pop("strip_quoted_reply_chains", UNSET) + ) + update_memory_bank_body = cls( compaction_prompt=compaction_prompt, description=description, @@ -180,6 +207,7 @@ def _parse_retention_days(data: object) -> int | None | Unset: max_turns=max_turns, name=name, retention_days=retention_days, + strip_quoted_reply_chains=strip_quoted_reply_chains, ) update_memory_bank_body.additional_properties = d diff --git a/seclai/_generated/models/update_source_body.py b/seclai/_generated/models/update_source_body.py index 19039bc..f946686 100644 --- a/seclai/_generated/models/update_source_body.py +++ b/seclai/_generated/models/update_source_body.py @@ -17,17 +17,20 @@ class UpdateSourceBody: 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). + 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). 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. + retention_days (int | None | Unset): New retention period in days — content older than this is deleted + permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it + unchanged. """ media_types: list[str] | None | Unset = UNSET name: None | str | Unset = UNSET polling: None | str | Unset = UNSET - retention_days: int | None | Unset = -1 + retention_days: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/seclai/_generated/models/variant_option_response.py b/seclai/_generated/models/variant_option_response.py index 4c86dec..4be2180 100644 --- a/seclai/_generated/models/variant_option_response.py +++ b/seclai/_generated/models/variant_option_response.py @@ -20,11 +20,17 @@ class VariantOptionResponse: 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_1h_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to a + 1-hour prompt cache. + input_30m_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to + a 30-minute prompt cache. + input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens written to a + 5-minute prompt cache. + input_cache_hit_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens read from a + prompt cache. input_credits_per_1000_tokens (float | None | Unset): - long_context_input_cache_hit_credits_per_1000_tokens (float | None | Unset): + long_context_input_cache_hit_credits_per_1000_tokens (float | None | Unset): Credits per 1,000 input tokens read + from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens. 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): @@ -36,6 +42,7 @@ class VariantOptionResponse: value: str description: None | str | Unset = UNSET input_1h_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET + input_30m_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 @@ -67,6 +74,14 @@ def to_dict(self) -> dict[str, Any]: self.input_1h_cache_write_credits_per_1000_tokens ) + input_30m_cache_write_credits_per_1000_tokens: float | None | Unset + if isinstance(self.input_30m_cache_write_credits_per_1000_tokens, Unset): + input_30m_cache_write_credits_per_1000_tokens = UNSET + else: + input_30m_cache_write_credits_per_1000_tokens = ( + self.input_30m_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 @@ -140,6 +155,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( input_1h_cache_write_credits_per_1000_tokens ) + if input_30m_cache_write_credits_per_1000_tokens is not UNSET: + field_dict["input_30m_cache_write_credits_per_1000_tokens"] = ( + input_30m_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 @@ -204,6 +223,21 @@ def _parse_input_1h_cache_write_credits_per_1000_tokens( ) ) + def _parse_input_30m_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_30m_cache_write_credits_per_1000_tokens = ( + _parse_input_30m_cache_write_credits_per_1000_tokens( + d.pop("input_30m_cache_write_credits_per_1000_tokens", UNSET) + ) + ) + def _parse_input_5m_cache_write_credits_per_1000_tokens( data: object, ) -> float | None | Unset: @@ -318,6 +352,7 @@ def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: value=value, description=description, input_1h_cache_write_credits_per_1000_tokens=input_1h_cache_write_credits_per_1000_tokens, + input_30m_cache_write_credits_per_1000_tokens=input_30m_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, diff --git a/seclai/seclai.py b/seclai/seclai.py index 80269dc..04a1b14 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -95,9 +95,9 @@ class AgentRunStreamRequest(TypedDict): 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`` + Some 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 + per-resource key (``configs``, ``alerts``, ``models`` and the like); 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. @@ -140,8 +140,31 @@ def unwrap_items(payload: Any, *legacy_keys: str) -> list[dict[str, Any]]: ) -#: Deprecated alias kept for internal call sites; use :func:`unwrap_items`. -_unwrap_data = unwrap_items +def _as_page(result: Any) -> dict[str, Any]: + """Normalise a version-gated list response to the ``{data, ...}`` envelope. + + The canonical envelope is passed through untouched, including its + ``pagination`` key; the legacy bare array is wrapped so callers can read + ``["data"]`` either way and use ``.get("pagination")`` to tell them apart. + """ + if isinstance(result, dict): + return cast(dict[str, Any], result) + return {"data": result} + + +def _empty_page(*, page: int, limit: int) -> dict[str, Any]: + """The canonical envelope for a listing that matched nothing.""" + return { + "data": [], + "pagination": { + "page": page, + "limit": limit, + "total": 0, + "pages": 0, + "has_next": False, + "has_prev": False, + }, + } def _strip_none(params: dict[str, Any]) -> dict[str, Any]: @@ -149,6 +172,19 @@ def _strip_none(params: dict[str, Any]) -> dict[str, Any]: return {k: v for k, v in params.items() if v is not None} +def _expect_model[ModelT](parsed: object, model: type[ModelT]) -> ModelT: + """Narrow a generated-client result to the success model its caller declares. + + The generated union also carries each documented error body, which the + status check before this call has already raised on. + """ + if not isinstance(parsed, model): + raise SeclaiError( + f"Expected {model.__name__} in the response, got {type(parsed).__name__}." + ) + return parsed + + class SeclaiError(Exception): """Base error for the Seclai SDK.""" @@ -274,6 +310,44 @@ class ClientOptions: allow_unknown_api_version: bool = False +def _merge_headers( + base: dict[str, str], overrides: Mapping[str, str] | None +) -> dict[str, str]: + """Apply ``overrides`` onto ``base`` case-insensitively, in place. + + Header names are case-insensitive on the wire but dict keys are not, so a + plain ``dict.update`` leaves two spellings of one header in the mapping; + httpx then emits both and the server picks one arbitrarily. Every merge + point in this module goes through here so an override always *replaces* + rather than joins — including the per-request ``headers=`` path, where a + differently-cased ``Seclai-Version`` or ``X-Api-Key`` would otherwise be + appended alongside the client's own. + + The match is recomputed per key rather than once up front: ``overrides`` may + itself carry two spellings of one header, and a snapshot taken before the + loop would not see the first of them being added. + """ + if not overrides: + return base + for key, value in overrides.items(): + lowered = key.lower() + for existing in [k for k in base if k.lower() == lowered]: + del base[existing] + base[key] = value + return base + + +def _setdefault_header(headers: dict[str, str], name: str, value: str) -> None: + """Set ``name`` only when no spelling of it is already present. + + ``dict.setdefault`` is case-sensitive, so a caller-supplied ``Accept`` would + not stop the SDK adding its own lowercase ``accept`` and both would go out. + """ + lowered = name.lower() + if not any(k.lower() == lowered for k in headers): + headers[name] = value + + def _build_default_headers( *, auth_state: AuthState, @@ -303,19 +377,7 @@ def _build_default_headers( # 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 + return _merge_headers(headers, default_headers) def _merge_request_headers( @@ -337,9 +399,8 @@ def _merge_request_headers( 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) + _merge_headers(merged, auth_headers) + _merge_headers(merged, request_headers) return merged @@ -362,9 +423,8 @@ async def _merge_request_headers_async( 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) + _merge_headers(merged, auth_headers) + _merge_headers(merged, request_headers) return merged @@ -388,14 +448,26 @@ def _raise_for_status(response: httpx.Response) -> None: 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), - ) + # `detail` only holds a list of `{loc, msg, type}` objects when the + # 422 came from request-model validation. A hand-raised + # `HTTPException(422, detail="...")` puts a bare string there, and + # `from_dict` then iterates it and raises ValueError/TypeError/ + # KeyError from inside the generated models. Fall through to the + # status error rather than replacing an API failure with a decoding + # one that no `except SeclaiError` handler catches. + try: + validation_error = HTTPValidationError.from_dict(payload) + except Exception: + validation_error = None + if validation_error is not None: + 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=validation_error, + ) raise SeclaiAPIStatusError( message=f"Request failed with status {response.status_code}", status_code=response.status_code, @@ -476,6 +548,12 @@ def __init__( except RuntimeError as e: raise SeclaiConfigurationError(str(e)) from e + # Snapshotted, not aliased: `_build_default_headers` re-reads this on + # every request, so keeping the caller's mapping would let a later + # `hdrs["Seclai-Version"] = ...` put an unvalidated version on the wire + # and defeat the guard below. + frozen_headers: dict[str, str] = dict(default_headers or {}) + # `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 @@ -483,17 +561,23 @@ def __init__( # 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(): + header_version: str | None = None + for k, v in frozen_headers.items(): if k.lower() == "seclai-version": header_version = v + # `is None`, not truthiness: an empty `Seclai-Version` still reaches the + # wire and still suppresses the `api_version` opt-in, so it has to be + # validated (and rejected) rather than read as "no header supplied". try: validate_api_version( - header_version or api_version, allow_unknown=allow_unknown_api_version + api_version if header_version is None else header_version, + allow_unknown=allow_unknown_api_version, ) except ValueError as e: source = ( - "default_headers['Seclai-Version']" if header_version else "api_version" + "default_headers['Seclai-Version']" + if header_version is not None + else "api_version" ) raise SeclaiConfigurationError(f"{e} (via {source})") from e @@ -501,7 +585,7 @@ def __init__( auth_state=auth_state, timeout=timeout, api_key_header=api_key_header, - default_headers=default_headers or {}, + default_headers=frozen_headers, api_version=api_version, allow_unknown_api_version=allow_unknown_api_version, ) @@ -891,7 +975,7 @@ def run_streaming_agent_and_wait( merged_headers = _merge_request_headers( options=self._options, request_headers=headers ) - merged_headers.setdefault("accept", "text/event-stream") + _setdefault_header(merged_headers, "accept", "text/event-stream") timeout_seconds = self._options.timeout if timeout is None else timeout start = _time.monotonic() @@ -904,16 +988,10 @@ def run_streaming_agent_and_wait( 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), - ) + 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) current_event: str | None = None @@ -1027,7 +1105,7 @@ def list_agent_runs( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunListResponse) @overload def get_agent_run( @@ -1101,7 +1179,7 @@ def get_agent_run( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunResponse) @overload def delete_agent_run(self, run_id: str, /) -> AgentRunResponse: ... @@ -1163,7 +1241,7 @@ def delete_agent_run(self, *args: str) -> AgentRunResponse: response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunResponse) def get_content_detail( self, @@ -1223,7 +1301,7 @@ def get_content_detail( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, ContentDetailResponse) def delete_content(self, source_connection_content_version: str) -> None: """Delete a specific content version. @@ -1312,7 +1390,7 @@ def list_content_embeddings( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, ContentEmbeddingsListResponse) def list_sources( self, @@ -1378,7 +1456,7 @@ def list_sources( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, SourceListResponse) def upload_file_to_source( self, @@ -1670,7 +1748,7 @@ def upload_file_to_content( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, FileUploadResponse) finally: if created_payload is not None: created_payload.close() @@ -2216,7 +2294,7 @@ def list_evaluation_criteria( page_result = self.list_evaluation_criteria_page( agent_id, page=page, limit=limit ) - return _unwrap_data(page_result) + return unwrap_items(page_result) def list_evaluation_criteria_page( self, agent_id: str, *, page: int = 1, limit: int = 50 @@ -2243,9 +2321,7 @@ def list_evaluation_criteria_page( 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} + return _as_page(result) def create_evaluation_criteria( self, agent_id: str, body: dict[str, Any] @@ -2459,7 +2535,7 @@ def list_run_evaluation_results( page_result = self.list_run_evaluation_results_page( agent_id, run_id, page=page, limit=limit ) - return _unwrap_data(page_result) + return unwrap_items(page_result) def list_run_evaluation_results_page( self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 @@ -2483,9 +2559,7 @@ def list_run_evaluation_results_page( 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} + return _as_page(result) def list_evaluation_runs( self, agent_id: str, *, page: int = 1, limit: int = 50 @@ -3111,6 +3185,74 @@ def upload_inline_text_to_source( ), ) + def list_source_contents( + self, + source_id: str, + *, + page: int | None = None, + limit: int | None = None, + sort: str | None = None, + order: str | None = None, + status: str | None = None, + content_version_ids: list[str] | None = None, + ) -> dict[str, Any]: + """List a source's content items and their indexing status. + + Args: + source_id: Source identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + sort: Sort field — ``created_at``, ``title`` or ``status``. + order: ``asc`` or ``desc``. + status: Keep only one status: ``pending``, ``fetching``, + ``transcribing``, ``scanning``, ``indexing``, ``completed`` or + ``failed``. + content_version_ids: Keep only these items — the + ``content_version_id`` values the upload methods return — to + poll a batch of uploads in one request. + + Returns: + ``{"data": [...], "pagination": {...}}`` on every API version. An + empty ``content_version_ids`` matches nothing: an empty page is + returned without sending a request. + """ + if content_version_ids is not None and not content_version_ids: + return _empty_page(page=page or 1, limit=limit or 20) + return cast( + dict[str, Any], + self.request( + "GET", + f"/sources/{source_id}/contents", + params=_strip_none( + { + "page": page, + "limit": limit, + "sort": sort, + "order": order, + "status": status, + "content_version_id": content_version_ids, + } + ), + ), + ) + + def get_source_content_status( + self, source_id: str, content_version_id: str + ) -> dict[str, Any]: + """Get one content item's indexing status. + + Args: + source_id: Source identifier. + content_version_id: The ``content_version_id`` an upload returned. + + Returns: + The item and its indexing status. + """ + return cast( + dict[str, Any], + self.request("GET", f"/sources/{source_id}/contents/{content_version_id}"), + ) + # ── Source Exports ──────────────────────────────────────────────────────── def list_source_exports( @@ -4057,6 +4199,47 @@ def get_generation_tiers(self) -> dict[str, Any]: """ return cast(dict[str, Any], self.request("GET", "/models/generation-tiers")) + def list_embedding_models( + self, *, supports_input_media: str | None = None + ) -> dict[str, Any]: + """List the embedding models a source can index with, and their pricing. + + Args: + supports_input_media: Keep only embedders that can index this input + modality. + + Returns: + The embedders under ``models`` by default, and under ``data`` with + ``pagination`` once the client opts in with + ``api_version="2026-07-27"`` or later; the defaults and pricing sit + beside them on either shape. Read the list with + :func:`unwrap_items`:: + + items = unwrap_items(client.list_embedding_models(), "models") + """ + return cast( + dict[str, Any], + self.request( + "GET", + "/models/embedders", + params=_strip_none({"supports_input_media": supports_input_media}), + ), + ) + + def list_reranker_models(self) -> dict[str, Any]: + """List the reranker models a knowledge base can use, and their pricing. + + Returns: + The rerankers under ``models`` by default, and under ``data`` with + ``pagination`` once the client opts in with + ``api_version="2026-07-27"`` or later; the default and pricing sit + beside them on either shape. Read the list with + :func:`unwrap_items`:: + + items = unwrap_items(client.list_reranker_models(), "models") + """ + return cast(dict[str, Any], self.request("GET", "/models/rerankers")) + # ── Model Playground Experiments ────────────────────────────────────────── def list_experiments( @@ -4145,6 +4328,112 @@ def delete_experiment(self, experiment_id: str) -> None: """ self.request("DELETE", f"/models/playground/experiments/{experiment_id}") + # ── Cloud Drives ────────────────────────────────────────────────────────── + + def list_cloud_drive_providers(self) -> list[dict[str, Any]]: + """List the cloud-drive providers available to the account. + + Returns: + The providers, read from either response shape. + """ + return unwrap_items(self.request("GET", "/cloud-drives/providers")) + + def list_cloud_drives(self) -> list[dict[str, Any]]: + """List the account's cloud-drive connections. + + Returns: + The connections, read from either response shape. + """ + return unwrap_items(self.request("GET", "/cloud-drives")) + + def get_cloud_drive(self, connection_id: str) -> dict[str, Any]: + """Get a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The connection. + """ + return cast( + dict[str, Any], self.request("GET", f"/cloud-drives/{connection_id}") + ) + + def update_cloud_drive( + self, connection_id: str, body: dict[str, Any] + ) -> dict[str, Any]: + """Update a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + body: Fields to change — ``name`` and/or ``folder_path``. + + Returns: + The updated connection. + """ + return cast( + dict[str, Any], + self.request("PATCH", f"/cloud-drives/{connection_id}", json=body), + ) + + def disconnect_cloud_drive(self, connection_id: str) -> dict[str, Any]: + """Disconnect a cloud-drive connection, keeping the connection itself. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The connection in its disconnected state. + """ + return cast( + dict[str, Any], + self.request("POST", f"/cloud-drives/{connection_id}/disconnect"), + ) + + def delete_cloud_drive(self, connection_id: str) -> None: + """Delete a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + """ + self.request("DELETE", f"/cloud-drives/{connection_id}") + + def get_agents_using_cloud_drive(self, connection_id: str) -> list[dict[str, Any]]: + """List the agents that use a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The agents, read from either response shape. + """ + return unwrap_items( + self.request("GET", f"/cloud-drives/{connection_id}/agents") + ) + + def list_cloud_drive_rejections( + self, connection_id: str, *, limit: int | None = None + ) -> list[dict[str, Any]]: + """List the files a cloud-drive connection skipped, newest first. + + A skipped file fires no trigger, so this is where to look when an agent + did not run for a file. + + Args: + connection_id: Cloud-drive connection identifier. + limit: Maximum number of rejections (1-200, default 50). + + Returns: + The rejections with their reasons, read from either response shape. + """ + return unwrap_items( + self.request( + "GET", + f"/cloud-drives/{connection_id}/rejections", + params=_strip_none({"limit": limit}), + ) + ) + # ── Search ──────────────────────────────────────────────────────────────── def search( @@ -4472,6 +4761,7 @@ def paginate( params: dict[str, Any] | None = None, limit: int = 50, items_key: str = "data", + param_style: str = "page", ) -> Generator[dict[str, Any]]: """Auto-paginate a list endpoint. @@ -4481,9 +4771,15 @@ def paginate( Args: method: HTTP method (typically ``"GET"``). path: API path. - params: Extra query parameters (``page`` and ``limit`` are managed automatically). + params: Extra query parameters (the cursor and ``limit`` are managed + automatically). limit: Items per page. items_key: JSON key containing the list of items (default ``"data"``). + param_style: ``"page"`` (default) sends a 1-indexed ``page``; + ``"offset"`` sends a 0-based ``offset``. A few endpoints — + ``/models/alerts`` among them — declare only ``offset`` and + reject or ignore ``page``, which makes every request after the + first return page 1. Yields: Individual item dicts from each page. @@ -4491,9 +4787,20 @@ def paginate( page = 1 base_params = dict(params) if params else {} while True: - base_params["page"] = page + if param_style == "offset": + base_params["offset"] = (page - 1) * limit + else: + base_params["page"] = page base_params["limit"] = limit result = self.request(method, path, params=base_params) + # A bare array is the legacy, unpaginated shape of the version-gated + # list endpoints (evaluation criteria and run evaluation results). + # It carries everything in one response, so yield it and stop rather + # than silently reporting no results. + if isinstance(result, list): + for item in result: + yield cast(dict[str, Any], item) + return if not isinstance(result, dict): return items = result.get(items_key, []) @@ -4574,7 +4881,7 @@ def run_streaming_agent( merged_headers = _merge_request_headers( options=self._options, request_headers=headers ) - merged_headers.setdefault("accept", "text/event-stream") + _setdefault_header(merged_headers, "accept", "text/event-stream") timeout_seconds = self._options.timeout if timeout is None else timeout start = time.monotonic() @@ -4586,6 +4893,10 @@ 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) current_event: str | None = None data_lines: list[str] = [] @@ -4887,7 +5198,7 @@ async def run_streaming_agent_and_wait( merged_headers = await _merge_request_headers_async( options=self._options, request_headers=headers ) - merged_headers.setdefault("accept", "text/event-stream") + _setdefault_header(merged_headers, "accept", "text/event-stream") timeout_seconds = self._options.timeout if timeout is None else timeout start = _time.monotonic() @@ -4900,16 +5211,10 @@ async def run_streaming_agent_and_wait( 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), - ) + 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) current_event: str | None = None @@ -5023,7 +5328,7 @@ async def list_agent_runs( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunListResponse) @overload async def get_agent_run( @@ -5097,7 +5402,7 @@ async def get_agent_run( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunResponse) @overload async def delete_agent_run(self, run_id: str, /) -> AgentRunResponse: ... @@ -5164,7 +5469,7 @@ async def delete_agent_run(self, *args: str) -> AgentRunResponse: response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, AgentRunResponse) async def get_content_detail( self, @@ -5224,7 +5529,7 @@ async def get_content_detail( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, ContentDetailResponse) async def delete_content(self, source_connection_content_version: str) -> None: """Delete a specific content version. @@ -5313,7 +5618,7 @@ async def list_content_embeddings( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, ContentEmbeddingsListResponse) async def list_sources( self, @@ -5379,7 +5684,7 @@ async def list_sources( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, SourceListResponse) async def upload_file_to_source( self, @@ -5668,7 +5973,7 @@ async def upload_file_to_content( response_text=None, validation_error=parsed, ) - return parsed + return _expect_model(parsed, FileUploadResponse) finally: if created_payload is not None: created_payload.close() @@ -6232,7 +6537,7 @@ async def list_evaluation_criteria( page_result = await self.list_evaluation_criteria_page( agent_id, page=page, limit=limit ) - return _unwrap_data(page_result) + return unwrap_items(page_result) async def list_evaluation_criteria_page( self, agent_id: str, *, page: int = 1, limit: int = 50 @@ -6259,9 +6564,7 @@ async def list_evaluation_criteria_page( 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} + return _as_page(result) async def create_evaluation_criteria( self, agent_id: str, body: dict[str, Any] @@ -6475,7 +6778,7 @@ async def list_run_evaluation_results( page_result = await self.list_run_evaluation_results_page( agent_id, run_id, page=page, limit=limit ) - return _unwrap_data(page_result) + return unwrap_items(page_result) async def list_run_evaluation_results_page( self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 @@ -6499,9 +6802,7 @@ async def list_run_evaluation_results_page( 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} + return _as_page(result) async def list_evaluation_runs( self, agent_id: str, *, page: int = 1, limit: int = 50 @@ -7138,6 +7439,76 @@ async def upload_inline_text_to_source( ), ) + async def list_source_contents( + self, + source_id: str, + *, + page: int | None = None, + limit: int | None = None, + sort: str | None = None, + order: str | None = None, + status: str | None = None, + content_version_ids: list[str] | None = None, + ) -> dict[str, Any]: + """List a source's content items and their indexing status. + + Args: + source_id: Source identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + sort: Sort field — ``created_at``, ``title`` or ``status``. + order: ``asc`` or ``desc``. + status: Keep only one status: ``pending``, ``fetching``, + ``transcribing``, ``scanning``, ``indexing``, ``completed`` or + ``failed``. + content_version_ids: Keep only these items — the + ``content_version_id`` values the upload methods return — to + poll a batch of uploads in one request. + + Returns: + ``{"data": [...], "pagination": {...}}`` on every API version. An + empty ``content_version_ids`` matches nothing: an empty page is + returned without sending a request. + """ + if content_version_ids is not None and not content_version_ids: + return _empty_page(page=page or 1, limit=limit or 20) + return cast( + dict[str, Any], + await self.request( + "GET", + f"/sources/{source_id}/contents", + params=_strip_none( + { + "page": page, + "limit": limit, + "sort": sort, + "order": order, + "status": status, + "content_version_id": content_version_ids, + } + ), + ), + ) + + async def get_source_content_status( + self, source_id: str, content_version_id: str + ) -> dict[str, Any]: + """Get one content item's indexing status. + + Args: + source_id: Source identifier. + content_version_id: The ``content_version_id`` an upload returned. + + Returns: + The item and its indexing status. + """ + return cast( + dict[str, Any], + await self.request( + "GET", f"/sources/{source_id}/contents/{content_version_id}" + ), + ) + # ── Source Exports ──────────────────────────────────────────────────────── async def list_source_exports( @@ -7901,7 +8272,7 @@ async def list_alert_configs(self, *, page: int = 1, limit: int = 50) -> JSONVal ``api_version="2026-07-27"`` or later. Read either with :func:`unwrap_items`:: - items = unwrap_items(client.list_alert_configs(), "configs") + items = unwrap_items(await client.list_alert_configs(), "configs") """ return await self.request( "GET", @@ -8099,13 +8470,54 @@ async def get_generation_tiers(self) -> dict[str, Any]: ``api_version="2026-07-27"`` or later. Read either with :func:`unwrap_items`:: - items = unwrap_items(client.get_generation_tiers(), "tiers") + items = unwrap_items(await client.get_generation_tiers(), "tiers") """ return cast( dict[str, Any], await self.request("GET", "/models/generation-tiers"), ) + async def list_embedding_models( + self, *, supports_input_media: str | None = None + ) -> dict[str, Any]: + """List the embedding models a source can index with, and their pricing. + + Args: + supports_input_media: Keep only embedders that can index this input + modality. + + Returns: + The embedders under ``models`` by default, and under ``data`` with + ``pagination`` once the client opts in with + ``api_version="2026-07-27"`` or later; the defaults and pricing sit + beside them on either shape. Read the list with + :func:`unwrap_items`:: + + items = unwrap_items(await client.list_embedding_models(), "models") + """ + return cast( + dict[str, Any], + await self.request( + "GET", + "/models/embedders", + params=_strip_none({"supports_input_media": supports_input_media}), + ), + ) + + async def list_reranker_models(self) -> dict[str, Any]: + """List the reranker models a knowledge base can use, and their pricing. + + Returns: + The rerankers under ``models`` by default, and under ``data`` with + ``pagination`` once the client opts in with + ``api_version="2026-07-27"`` or later; the default and pricing sit + beside them on either shape. Read the list with + :func:`unwrap_items`:: + + items = unwrap_items(await client.list_reranker_models(), "models") + """ + return cast(dict[str, Any], await self.request("GET", "/models/rerankers")) + # ── Model Playground Experiments ────────────────────────────────────────── async def list_experiments( @@ -8127,7 +8539,12 @@ async def list_experiments( offset: Pagination offset. Returns: - Paginated list of experiments. + 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(await client.list_experiments(), "experiments") """ return await self.request( "GET", @@ -8191,6 +8608,115 @@ async def delete_experiment(self, experiment_id: str) -> None: """ await self.request("DELETE", f"/models/playground/experiments/{experiment_id}") + # ── Cloud Drives ────────────────────────────────────────────────────────── + + async def list_cloud_drive_providers(self) -> list[dict[str, Any]]: + """List the cloud-drive providers available to the account. + + Returns: + The providers, read from either response shape. + """ + return unwrap_items(await self.request("GET", "/cloud-drives/providers")) + + async def list_cloud_drives(self) -> list[dict[str, Any]]: + """List the account's cloud-drive connections. + + Returns: + The connections, read from either response shape. + """ + return unwrap_items(await self.request("GET", "/cloud-drives")) + + async def get_cloud_drive(self, connection_id: str) -> dict[str, Any]: + """Get a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The connection. + """ + return cast( + dict[str, Any], + await self.request("GET", f"/cloud-drives/{connection_id}"), + ) + + async def update_cloud_drive( + self, connection_id: str, body: dict[str, Any] + ) -> dict[str, Any]: + """Update a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + body: Fields to change — ``name`` and/or ``folder_path``. + + Returns: + The updated connection. + """ + return cast( + dict[str, Any], + await self.request("PATCH", f"/cloud-drives/{connection_id}", json=body), + ) + + async def disconnect_cloud_drive(self, connection_id: str) -> dict[str, Any]: + """Disconnect a cloud-drive connection, keeping the connection itself. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The connection in its disconnected state. + """ + return cast( + dict[str, Any], + await self.request("POST", f"/cloud-drives/{connection_id}/disconnect"), + ) + + async def delete_cloud_drive(self, connection_id: str) -> None: + """Delete a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + """ + await self.request("DELETE", f"/cloud-drives/{connection_id}") + + async def get_agents_using_cloud_drive( + self, connection_id: str + ) -> list[dict[str, Any]]: + """List the agents that use a cloud-drive connection. + + Args: + connection_id: Cloud-drive connection identifier. + + Returns: + The agents, read from either response shape. + """ + return unwrap_items( + await self.request("GET", f"/cloud-drives/{connection_id}/agents") + ) + + async def list_cloud_drive_rejections( + self, connection_id: str, *, limit: int | None = None + ) -> list[dict[str, Any]]: + """List the files a cloud-drive connection skipped, newest first. + + A skipped file fires no trigger, so this is where to look when an agent + did not run for a file. + + Args: + connection_id: Cloud-drive connection identifier. + limit: Maximum number of rejections (1-200, default 50). + + Returns: + The rejections with their reasons, read from either response shape. + """ + return unwrap_items( + await self.request( + "GET", + f"/cloud-drives/{connection_id}/rejections", + params=_strip_none({"limit": limit}), + ) + ) + # ── Search ──────────────────────────────────────────────────────────────── async def search( @@ -8522,6 +9048,7 @@ async def paginate( params: dict[str, Any] | None = None, limit: int = 50, items_key: str = "data", + param_style: str = "page", ) -> AsyncGenerator[dict[str, Any]]: """Auto-paginate a list endpoint, yielding items lazily. @@ -8532,9 +9059,15 @@ async def paginate( Args: method: HTTP method (typically ``"GET"``). path: API path. - params: Extra query parameters (``page`` and ``limit`` are managed automatically). + params: Extra query parameters (the cursor and ``limit`` are managed + automatically). limit: Items per page. items_key: JSON key containing the list of items (default ``"data"``). + param_style: ``"page"`` (default) sends a 1-indexed ``page``; + ``"offset"`` sends a 0-based ``offset``. A few endpoints — + ``/models/alerts`` among them — declare only ``offset`` and + reject or ignore ``page``, which makes every request after the + first return page 1. Yields: Individual items from each page. @@ -8542,9 +9075,20 @@ async def paginate( page = 1 base_params = dict(params) if params else {} while True: - base_params["page"] = page + if param_style == "offset": + base_params["offset"] = (page - 1) * limit + else: + base_params["page"] = page base_params["limit"] = limit result = await self.request(method, path, params=base_params) + # A bare array is the legacy, unpaginated shape of the version-gated + # list endpoints (evaluation criteria and run evaluation results). + # It carries everything in one response, so yield it and stop rather + # than silently reporting no results. + if isinstance(result, list): + for item in result: + yield cast(dict[str, Any], item) + break if not isinstance(result, dict): break items = result.get(items_key, []) @@ -8627,7 +9171,7 @@ async def run_streaming_agent( merged_headers = await _merge_request_headers_async( options=self._options, request_headers=headers ) - merged_headers.setdefault("accept", "text/event-stream") + _setdefault_header(merged_headers, "accept", "text/event-stream") timeout_seconds = self._options.timeout if timeout is None else timeout start = time.monotonic() @@ -8639,6 +9183,10 @@ 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) current_event: str | None = None data_lines: list[str] = [] diff --git a/seclai/versions.py b/seclai/versions.py index 6305958..7ebfb70 100644 --- a/seclai/versions.py +++ b/seclai/versions.py @@ -1,10 +1,12 @@ """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. +The API adds versions without an SDK release, so the server's set is always a +superset of this one — :meth:`Seclai.get_api_version` reports what it actually +supports. This list is nonetheless the client's **allowlist**, not a set of +convenience constants: :func:`validate_api_version` fails closed on anything +absent from it, because a newer version can reshape responses that this release +would then mis-decode rather than reject. To move ahead of the SDK, pass +``allow_unknown_api_version=True`` to the client. """ from __future__ import annotations @@ -18,13 +20,18 @@ class ApiVersion(StrEnum): V2026_07_01 = "2026-07-01" V2026_07_27 = "2026-07-27" + V2026_08_03 = "2026-08-03" + V2026_08_21 = "2026-08-21" + V2026_09_28 = "2026-09-28" + V2026_09_30 = "2026-09-30" + V2026_10_03 = "2026-10-03" #: 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 +LATEST_API_VERSION = ApiVersion.V2026_10_03 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 19644e9..53e0461 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -14,7 +14,7 @@ import pytest import seclai -from seclai import AsyncSeclai, Seclai +from seclai import AgentRunStreamRequest, AsyncSeclai, Seclai from seclai import versions as seclai_versions # --------------------------------------------------------------------------- @@ -3101,13 +3101,20 @@ def test_get_generation_tiers(self) -> None: 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) + # The legacy shape the endpoint actually serves. The previous + # fixture used a nested modality->tier mapping the API never sends, + # which the documented `unwrap_items(..., "tiers")` cannot read. + return _json_response( + {"tiers": [{"modality": "image", "tier": "fast"}]}, 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"}}} + assert seclai.unwrap_items(result, "tiers") == [ + {"modality": "image", "tier": "fast"} + ] def test_search_docs(self) -> None: seen: dict[str, Any] = {} @@ -3455,6 +3462,296 @@ def handler(req: httpx.Request) -> httpx.Response: assert seen["body"] == {"version": "2099-01-01"} +_ENVELOPE_PAGINATION = { + "page": 1, + "limit": 1, + "total": 1, + "pages": 1, + "has_next": False, + "has_prev": False, +} + +# (method, args, kwargs, verb, path, query, body) for every 2026-10 endpoint. +# One table drives the sync and async tests, so the two classes cannot be +# asserted against different expectations. +_SYNC_2026_10_CALLS: list[ + tuple[str, tuple[Any, ...], dict[str, Any], str, str, list[tuple[str, str]], Any] +] = [ + ("list_cloud_drive_providers", (), {}, "GET", "/cloud-drives/providers", [], None), + ("list_cloud_drives", (), {}, "GET", "/cloud-drives", [], None), + ("get_cloud_drive", ("c1",), {}, "GET", "/cloud-drives/c1", [], None), + ( + "update_cloud_drive", + ("c1", {"name": "Contracts"}), + {}, + "PATCH", + "/cloud-drives/c1", + [], + {"name": "Contracts"}, + ), + ( + "disconnect_cloud_drive", + ("c1",), + {}, + "POST", + "/cloud-drives/c1/disconnect", + [], + None, + ), + ("delete_cloud_drive", ("c1",), {}, "DELETE", "/cloud-drives/c1", [], None), + ( + "get_agents_using_cloud_drive", + ("c1",), + {}, + "GET", + "/cloud-drives/c1/agents", + [], + None, + ), + ( + "list_cloud_drive_rejections", + ("c1",), + {"limit": 20}, + "GET", + "/cloud-drives/c1/rejections", + [("limit", "20")], + None, + ), + ( + "list_cloud_drive_rejections", + ("c1",), + {}, + "GET", + "/cloud-drives/c1/rejections", + [], + None, + ), + ( + "list_embedding_models", + (), + {"supports_input_media": "image"}, + "GET", + "/models/embedders", + [("supports_input_media", "image")], + None, + ), + ("list_reranker_models", (), {}, "GET", "/models/rerankers", [], None), + ( + "list_source_contents", + ("s1",), + { + "page": 2, + "limit": 10, + "sort": "title", + "order": "asc", + "status": "failed", + "content_version_ids": ["cv1", "cv2"], + }, + "GET", + "/sources/s1/contents", + [ + ("page", "2"), + ("limit", "10"), + ("sort", "title"), + ("order", "asc"), + ("status", "failed"), + ("content_version_id", "cv1"), + ("content_version_id", "cv2"), + ], + None, + ), + ("list_source_contents", ("s1",), {}, "GET", "/sources/s1/contents", [], None), + ( + "get_source_content_status", + ("s1", "cv1"), + {}, + "GET", + "/sources/s1/contents/cv1", + [], + None, + ), +] + +# Methods that return the items of a version-gated list, and so must read both +# the legacy bare array and the canonical envelope. +_LIST_2026_10_METHODS = [ + ("list_cloud_drive_providers", ()), + ("list_cloud_drives", ()), + ("get_agents_using_cloud_drive", ("c1",)), + ("list_cloud_drive_rejections", ("c1",)), +] + + +def _recording_handler(seen: dict[str, Any], body: Any) -> 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()) + seen["body"] = json.loads(req.content) if req.content else None + return _json_response(body) + + return handler + + +class TestCloudDrivesModelsAndSourceContents: + @pytest.mark.parametrize( + ("name", "args", "kwargs", "verb", "path", "query", "body"), + _SYNC_2026_10_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, {"data": []})) + getattr(client, name)(*args, **kwargs) + assert seen == {"method": verb, "path": path, "query": query, "body": body} + + @pytest.mark.asyncio + @pytest.mark.parametrize( + ("name", "args", "kwargs", "verb", "path", "query", "body"), + _SYNC_2026_10_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, {"data": []})) + await getattr(client, name)(*args, **kwargs) + assert seen == {"method": verb, "path": path, "query": query, "body": body} + + @pytest.mark.parametrize(("name", "args"), _LIST_2026_10_METHODS) + @pytest.mark.parametrize( + "payload", + [[{"id": "x1"}], {"data": [{"id": "x1"}], "pagination": _ENVELOPE_PAGINATION}], + ids=["legacy-array", "envelope"], + ) + def test_list_reads_both_shapes( + self, name: str, args: tuple[Any, ...], payload: Any + ) -> None: + client = _sync_client(lambda req: _json_response(payload)) + assert getattr(client, name)(*args) == [{"id": "x1"}] + + @pytest.mark.asyncio + @pytest.mark.parametrize(("name", "args"), _LIST_2026_10_METHODS) + @pytest.mark.parametrize( + "payload", + [[{"id": "x1"}], {"data": [{"id": "x1"}], "pagination": _ENVELOPE_PAGINATION}], + ids=["legacy-array", "envelope"], + ) + async def test_list_reads_both_shapes_async( + self, name: str, args: tuple[Any, ...], payload: Any + ) -> None: + client = _async_client(lambda req: _json_response(payload)) + assert await getattr(client, name)(*args) == [{"id": "x1"}] + + @pytest.mark.parametrize("name", ["list_embedding_models", "list_reranker_models"]) + @pytest.mark.parametrize( + "payload", + [ + {"models": [{"model_type": "m1"}], "default_model_type": "m1"}, + { + "data": [{"model_type": "m1"}], + "pagination": _ENVELOPE_PAGINATION, + "default_model_type": "m1", + }, + ], + ids=["legacy-key", "envelope"], + ) + def test_model_listing_keeps_pricing_beside_the_items( + self, name: str, payload: Any + ) -> None: + client = _sync_client(lambda req: _json_response(payload)) + result = getattr(client, name)() + assert seclai.unwrap_items(result, "models") == [{"model_type": "m1"}] + assert result["default_model_type"] == "m1" + + def test_an_empty_content_version_filter_matches_nothing(self) -> None: + # An empty list encodes as no parameter at all, which the API reads as + # "no filter" and answers with every item in the source. + requests: list[httpx.Request] = [] + + def handler(req: httpx.Request) -> httpx.Response: + requests.append(req) + return _json_response({"data": [{"id": "x1"}]}) + + client = _sync_client(handler) + result = client.list_source_contents( + "s1", page=3, limit=50, content_version_ids=[] + ) + assert requests == [] + assert result == { + "data": [], + "pagination": {**_ENVELOPE_PAGINATION, "page": 3, "limit": 50} + | {"total": 0, "pages": 0}, + } + + @pytest.mark.asyncio + async def test_an_empty_content_version_filter_matches_nothing_async( + self, + ) -> None: + requests: list[httpx.Request] = [] + + def handler(req: httpx.Request) -> httpx.Response: + requests.append(req) + return _json_response({"data": [{"id": "x1"}]}) + + client = _async_client(handler) + result = await client.list_source_contents("s1", content_version_ids=[]) + assert requests == [] + assert result["data"] == [] + assert result["pagination"]["page"] == 1 + assert result["pagination"]["limit"] == 20 + assert result["pagination"]["total"] == 0 + + +def _unread_validation_error(req: httpx.Request) -> httpx.Response: + """A 422 whose body is still a stream, as it is on a real connection.""" + + def body() -> Any: + yield json.dumps( + {"detail": [{"loc": ["body", "input"], "msg": "required", "type": "x"}]} + ).encode() + + return httpx.Response( + 422, headers={"content-type": "application/json"}, content=body() + ) + + +class TestStreamingErrorBodies: + def test_a_422_from_run_and_wait_keeps_its_field_detail(self) -> None: + client = _sync_client(_unread_validation_error) + with pytest.raises(seclai.SeclaiAPIValidationError) as exc: + client.run_streaming_agent_and_wait( + "a1", AgentRunStreamRequest(input="hi", metadata={}) + ) + assert exc.value.response_text + assert exc.value.validation_error is not None + + def test_a_422_from_the_event_stream_keeps_its_field_detail(self) -> None: + client = _sync_client(_unread_validation_error) + events = client.run_streaming_agent( + "a1", AgentRunStreamRequest(input="hi", metadata={}) + ) + with pytest.raises(seclai.SeclaiAPIValidationError) as exc: + next(events) + assert exc.value.response_text + assert exc.value.validation_error is not None + + 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 @@ -3617,11 +3914,50 @@ def handler(req: httpx.Request) -> httpx.Response: assert seen["values"] == ["2099-01-01"] def test_a_known_version_in_default_headers_needs_no_escape_hatch(self) -> None: + # Asserting only that construction succeeded would pass even if the + # header were dropped on the way to the wire, so check the wire. + 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( - lambda req: _json_response({"data": []}), + handler, default_headers={"Seclai-Version": seclai_versions.LATEST_API_VERSION}, ) - assert client is not None + client.list_agents() + assert seen["values"] == [seclai_versions.LATEST_API_VERSION] + + def test_an_empty_version_header_is_rejected(self) -> None: + # An empty `Seclai-Version` still reaches the wire and still suppresses + # the `api_version` opt-in, so reading it as "no header supplied" let a + # client silently send a version it never validated. + with pytest.raises(seclai.SeclaiConfigurationError) as exc: + Seclai( + api_key="k", + api_version=seclai_versions.LATEST_API_VERSION, + default_headers={"Seclai-Version": ""}, + ) + assert "default_headers" in str(exc.value) + + def test_default_headers_are_snapshotted(self) -> None: + # `_build_default_headers` re-reads this mapping on every request, so + # holding the caller's dict let a later mutation put an unvalidated + # version on the wire. + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["values"] = req.headers.get_list("seclai-version") + return _json_response({"data": []}) + + headers: dict[str, str] = { + "Seclai-Version": seclai_versions.DEFAULT_API_VERSION + } + client = _sync_client(handler, default_headers=headers) + headers["Seclai-Version"] = "2099-01-01" + client.list_agents() + assert seen["values"] == [seclai_versions.DEFAULT_API_VERSION] class TestDuplicateVersionHeaderSpellings: @@ -3655,3 +3991,201 @@ def handler(req: httpx.Request) -> httpx.Response: ) client.list_agents() assert seen["values"] == [seclai_versions.LATEST_API_VERSION] + + +class TestValidationErrorsFromTheRequestPath: + """A 422 through `request()` must always surface as a SeclaiError. + + `HTTPValidationError.from_dict` assumes `detail` is a list of + `{loc, msg, type}` objects. A hand-raised `HTTPException(422, detail="...")` + is not, and parsing it unguarded turned an API failure into a ValueError / + TypeError / KeyError that no `except SeclaiError` handler catches. + """ + + def test_a_well_formed_detail_becomes_a_validation_error(self) -> None: + body = { + "detail": [{"loc": ["query", "q"], "msg": "field required", "type": "x"}] + } + client = _sync_client(lambda req: _json_response(body, status=422)) + with pytest.raises(seclai.SeclaiAPIValidationError) as exc: + client.get_me() + assert exc.value.status_code == 422 + assert exc.value.validation_error is not None + + @pytest.mark.parametrize( + "body", + [ + {"detail": "insufficient credits"}, + {"detail": None}, + {"detail": [{"msg": "bad", "type": "x"}]}, + {"detail": {"msg": "bad"}}, + {"errors": []}, + ], + ) + def test_an_unparseable_detail_still_raises_a_status_error(self, body: Any) -> None: + client = _sync_client(lambda req: _json_response(body, status=422)) + with pytest.raises(seclai.SeclaiAPIStatusError) as exc: + client.get_me() + assert exc.value.status_code == 422 + + def test_a_non_json_422_still_raises_a_status_error(self) -> None: + client = _sync_client( + lambda req: httpx.Response(status_code=422, text="gateway") + ) + with pytest.raises(seclai.SeclaiAPIStatusError): + client.get_me() + + @pytest.mark.asyncio + async def test_async_parity(self) -> None: + client = _async_client( + lambda req: _json_response({"detail": "nope"}, status=422) + ) + with pytest.raises(seclai.SeclaiAPIStatusError): + await client.get_me() + + +class TestPerRequestHeaderMerge: + """Per-request `headers=` must replace a default case-insensitively. + + Header names are case-insensitive on the wire but dict keys are not, so a + plain `dict.update` left two spellings in the mapping and httpx put both on + the wire for the server to choose between. + """ + + def test_a_per_request_version_replaces_the_client_default(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, api_version="2026-07-01") + client.request("GET", "/agents", headers={"Seclai-Version": "2026-07-27"}) + assert seen["values"] == ["2026-07-27"] + + def test_a_per_request_api_key_replaces_the_client_default(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["values"] = req.headers.get_list("x-api-key") + return _json_response({"data": []}) + + client = _sync_client(handler) + client.request("GET", "/agents", headers={"X-Api-Key": "override"}) + assert seen["values"] == ["override"] + + @pytest.mark.asyncio + async def test_async_parity(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 = _async_client(handler, api_version="2026-07-01") + await client.request("GET", "/agents", headers={"Seclai-Version": "2026-07-27"}) + assert seen["values"] == ["2026-07-27"] + + def test_a_caller_supplied_accept_replaces_the_streaming_default(self) -> None: + seen: dict[str, Any] = {} + + done = json.dumps( + { + "attempts": [], + "credits": None, + "error_count": 0, + "input": None, + "output": "ok", + "priority": False, + "run_id": "r1", + "status": "completed", + } + ) + + def handler(req: httpx.Request) -> httpx.Response: + seen["values"] = req.headers.get_list("accept") + return httpx.Response( + status_code=200, + headers={"content-type": "text/event-stream"}, + content=f"event: done\ndata: {done}\n\n".encode(), + ) + + client = _sync_client(handler) + client.run_streaming_agent_and_wait( + "a1", + AgentRunStreamRequest(input="x", metadata={}), + headers={"Accept": "text/event-stream"}, + ) + assert seen["values"] == ["text/event-stream"] + + +class TestUnwrapItems: + """`unwrap_items` is the documented entry point for the version-gated + endpoints that keep a per-resource key, but nothing exercised that path.""" + + def test_reads_a_bare_array(self) -> None: + assert seclai.unwrap_items([{"id": "a"}], "configs") == [{"id": "a"}] + + def test_prefers_data_over_the_legacy_key(self) -> None: + payload = {"data": [{"id": "new"}], "configs": [{"id": "old"}]} + assert seclai.unwrap_items(payload, "configs") == [{"id": "new"}] + + def test_reads_the_legacy_key(self) -> None: + payload = {"configs": [{"id": "a"}], "total": 1} + assert seclai.unwrap_items(payload, "configs") == [{"id": "a"}] + + def test_an_explicit_null_is_an_empty_page(self) -> None: + assert seclai.unwrap_items({"data": None}, "configs") == [] + + def test_an_unrecognised_envelope_raises(self) -> None: + with pytest.raises(seclai.SeclaiError): + seclai.unwrap_items({"widgets": []}, "configs") + + def test_a_non_list_under_a_known_key_raises(self) -> None: + with pytest.raises(seclai.SeclaiError): + seclai.unwrap_items({"data": {"id": "a"}}, "configs") + + +class TestPaginateShapes: + """`paginate()` predates the version-gated shapes and the offset-only + endpoints, so it sent `page` everywhere and could not read a bare array.""" + + def test_a_bare_array_yields_its_items_and_stops(self) -> None: + calls: list[int] = [] + + def handler(req: httpx.Request) -> httpx.Response: + calls.append(1) + return _json_response([{"id": "ec1"}, {"id": "ec2"}]) + + client = _sync_client(handler) + items = list(client.paginate("GET", "/agents/a1/evaluation-criteria")) + assert items == [{"id": "ec1"}, {"id": "ec2"}] + assert len(calls) == 1 + + def test_offset_style_sends_offset_not_page(self) -> None: + seen: list[dict[str, str]] = [] + + def handler(req: httpx.Request) -> httpx.Response: + seen.append(dict(req.url.params)) + return _json_response({"alerts": []}) + + client = _sync_client(handler) + list( + client.paginate( + "GET", + "/models/alerts", + items_key="alerts", + limit=25, + param_style="offset", + ) + ) + assert seen == [{"offset": "0", "limit": "25"}] + + @pytest.mark.asyncio + async def test_async_parity(self) -> None: + client = _async_client(lambda req: _json_response([{"id": "ec1"}])) + items = [ + item + async for item in client.paginate("GET", "/agents/a1/evaluation-criteria") + ] + assert items == [{"id": "ec1"}] From 0812c1ae038cd7ccdd5a89a2c70a227ccba67507 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Sun, 4 Oct 2026 17:14:51 -0700 Subject: [PATCH 3/6] #minor From ade735ef5bc29ad040671bdb023449a3825c5b89 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Sun, 4 Oct 2026 17:32:30 -0700 Subject: [PATCH 4/6] Fixed review findings --- CHANGELOG.md | 5 +- pyproject.toml | 2 +- seclai/seclai.py | 88 +++++++++---- tests/test_error_and_guard_paths.py | 193 ++++++++++++++++++++++++++++ 4 files changed, 260 insertions(+), 28 deletions(-) create mode 100644 tests/test_error_and_guard_paths.py diff --git a/CHANGELOG.md b/CHANGELOG.md index a3db491..e170d31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,9 +18,10 @@ ### Fixed - Read the body of an error response in the streaming methods. A 422 from `run_streaming_agent_and_wait()` escaped as `httpx.ResponseNotRead`, a 422 from `run_streaming_agent()` lost its field-level detail, and every streaming error had an empty `response_text` -- Raise `SeclaiAPIStatusError` on a 422 whose `detail` is a plain string. Decoding it as field-level validation raised `ValueError` from inside the generated models +- Raise `SeclaiAPIStatusError` on a 422 whose `detail` is a plain string, from every method including the typed ones and the uploads. Decoding it as field-level validation raised `ValueError` from inside the generated models +- Apply the unknown-version guard to a `Seclai-Version` passed in a per-request `headers` argument, on `request()` and the streaming methods. Any value was sent - Replace a header case-insensitively when a per-request `headers` argument or the auth layer supplies one the client already set. Both spellings were sent -- Yield the items from `paginate()` when the endpoint answers with a bare array. It yielded nothing +- Yield the items from `paginate()` when the endpoint answers with a bare array, or under `data` while a per-resource `items_key` was given. It yielded nothing in both cases, and now raises `SeclaiError` on a shape it cannot read - Copy `default_headers` at construction. Mutating the mapping afterwards put an unvalidated `Seclai-Version` on the wire - Reject an empty `Seclai-Version` in `default_headers`. It was read as absent, sent anyway, and suppressed `api_version` diff --git a/pyproject.toml b/pyproject.toml index 2b8abce..74719eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,7 +136,7 @@ filterwarnings = [ ] [tool.ruff] -target-version = "py313" +target-version = "py311" line-length = 88 exclude = [ # Vendored from seclai/sdk-tools via git subtree — formatting it here would diff --git a/seclai/seclai.py b/seclai/seclai.py index 04a1b14..00536e1 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -46,7 +46,7 @@ from http import HTTPStatus from io import BytesIO from pathlib import Path -from typing import Any, BinaryIO, Self, TypedDict, cast, overload +from typing import Any, BinaryIO, Literal, Self, TypedDict, TypeVar, cast, overload import httpx @@ -172,7 +172,10 @@ def _strip_none(params: dict[str, Any]) -> dict[str, Any]: return {k: v for k, v in params.items() if v is not None} -def _expect_model[ModelT](parsed: object, model: type[ModelT]) -> ModelT: +_ModelT = TypeVar("_ModelT") + + +def _expect_model(parsed: object, model: type[_ModelT]) -> _ModelT: """Narrow a generated-client result to the success model its caller declares. The generated union also carries each documented error body, which the @@ -317,11 +320,7 @@ def _merge_headers( Header names are case-insensitive on the wire but dict keys are not, so a plain ``dict.update`` leaves two spellings of one header in the mapping; - httpx then emits both and the server picks one arbitrarily. Every merge - point in this module goes through here so an override always *replaces* - rather than joins — including the per-request ``headers=`` path, where a - differently-cased ``Seclai-Version`` or ``X-Api-Key`` would otherwise be - appended alongside the client's own. + httpx then emits both and the server picks one arbitrarily. The match is recomputed per key rather than once up front: ``overrides`` may itself carry two spellings of one header, and a snapshot taken before the @@ -400,6 +399,7 @@ def _merge_request_headers( except Exception as exc: raise SeclaiConfigurationError(f"Auth resolution failed: {exc}") from exc _merge_headers(merged, auth_headers) + _validate_request_version(options, request_headers) _merge_headers(merged, request_headers) return merged @@ -424,6 +424,7 @@ async def _merge_request_headers_async( except Exception as exc: raise SeclaiConfigurationError(f"Auth resolution failed: {exc}") from exc _merge_headers(merged, auth_headers) + _validate_request_version(options, request_headers) _merge_headers(merged, request_headers) return merged @@ -477,6 +478,35 @@ def _raise_for_status(response: httpx.Response) -> None: ) +def _raise_on_error_status(response: httpx.Response) -> None: + """httpx response hook: raise for an error status before its body is decoded.""" + if response.status_code >= 400: + response.read() + _raise_for_status(response) + + +async def _raise_on_error_status_async(response: httpx.Response) -> None: + """Async twin of :func:`_raise_on_error_status`.""" + if response.status_code >= 400: + await response.aread() + _raise_for_status(response) + + +def _validate_request_version( + options: ClientOptions, request_headers: Mapping[str, str] | None +) -> None: + """Apply the unknown-version guard to a per-request ``Seclai-Version``.""" + for key, value in (request_headers or {}).items(): + if key.lower() != "seclai-version": + continue + try: + validate_api_version(value, allow_unknown=options.allow_unknown_api_version) + except ValueError as e: + raise SeclaiConfigurationError( + f"{e} (via headers['Seclai-Version'])" + ) from e + + class _SeclaiBase: """Shared implementation for Seclai sync/async clients. @@ -652,7 +682,11 @@ def _sync_generated_client(self) -> GeneratedClient: # 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] + client = self._generated_client() + hooks = client.get_httpx_client().event_hooks["response"] + if _raise_on_error_status not in hooks: + hooks.append(_raise_on_error_status) + return client async def _async_generated_client(self) -> GeneratedClient: """Return the generated client with dynamic auth headers applied (async). @@ -677,7 +711,11 @@ async def _async_generated_client(self) -> GeneratedClient: 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] + client = self._generated_client() + hooks = client.get_async_httpx_client().event_hooks["response"] + if _raise_on_error_status_async not in hooks: + hooks.append(_raise_on_error_status_async) + return client def _build_url(self, path: str) -> str: """Build an absolute URL string from a request path. @@ -3209,7 +3247,7 @@ def list_source_contents( ``failed``. content_version_ids: Keep only these items — the ``content_version_id`` values the upload methods return — to - poll a batch of uploads in one request. + poll a batch of uploads in one request. At most 500. Returns: ``{"data": [...], "pagination": {...}}`` on every API version. An @@ -4761,7 +4799,7 @@ def paginate( params: dict[str, Any] | None = None, limit: int = 50, items_key: str = "data", - param_style: str = "page", + param_style: Literal["page", "offset"] = "page", ) -> Generator[dict[str, Any]]: """Auto-paginate a list endpoint. @@ -4784,6 +4822,10 @@ def paginate( Yields: Individual item dicts from each page. """ + if param_style not in ("page", "offset"): + raise ValueError( + f"param_style must be 'page' or 'offset', not {param_style!r}" + ) page = 1 base_params = dict(params) if params else {} while True: @@ -4801,13 +4843,9 @@ def paginate( for item in result: yield cast(dict[str, Any], item) return - if not isinstance(result, dict): - return - items = result.get(items_key, []) - if not isinstance(items, list): - return + items = unwrap_items(result, items_key) for item in items: - yield cast(dict[str, Any], item) + yield item if len(items) < limit: return page += 1 @@ -7463,7 +7501,7 @@ async def list_source_contents( ``failed``. content_version_ids: Keep only these items — the ``content_version_id`` values the upload methods return — to - poll a batch of uploads in one request. + poll a batch of uploads in one request. At most 500. Returns: ``{"data": [...], "pagination": {...}}`` on every API version. An @@ -9048,7 +9086,7 @@ async def paginate( params: dict[str, Any] | None = None, limit: int = 50, items_key: str = "data", - param_style: str = "page", + param_style: Literal["page", "offset"] = "page", ) -> AsyncGenerator[dict[str, Any]]: """Auto-paginate a list endpoint, yielding items lazily. @@ -9072,6 +9110,10 @@ async def paginate( Yields: Individual items from each page. """ + if param_style not in ("page", "offset"): + raise ValueError( + f"param_style must be 'page' or 'offset', not {param_style!r}" + ) page = 1 base_params = dict(params) if params else {} while True: @@ -9089,13 +9131,9 @@ async def paginate( for item in result: yield cast(dict[str, Any], item) break - if not isinstance(result, dict): - break - items = result.get(items_key, []) - if not isinstance(items, list): - break + items = unwrap_items(result, items_key) for item in items: - yield cast(dict[str, Any], item) + yield item if len(items) < limit: break page += 1 diff --git a/tests/test_error_and_guard_paths.py b/tests/test_error_and_guard_paths.py new file mode 100644 index 0000000..9af825d --- /dev/null +++ b/tests/test_error_and_guard_paths.py @@ -0,0 +1,193 @@ +"""Error mapping on the generated-client path, and the guards on ``paginate()`` +and on a per-request ``Seclai-Version``.""" + +from __future__ import annotations + +from typing import Any + +import httpx +import pytest + +import seclai +from seclai import AgentRunStreamRequest, AsyncSeclai, Seclai + +_BASE_URL = "https://example.invalid" + +_FIELD_DETAIL = {"detail": [{"loc": ["query", "page"], "msg": "bad", "type": "x"}]} + + +def _typed_client(handler: Any) -> Seclai: + """A client whose typed (generated-client) methods answer from ``handler``.""" + client = Seclai(api_key="k") + client._generated_client().set_httpx_client( + httpx.Client(transport=httpx.MockTransport(handler), base_url=_BASE_URL) + ) + return client + + +def _request_client(handler: Any, **options: Any) -> Seclai: + return Seclai( + api_key="k", + http_client=httpx.Client( + transport=httpx.MockTransport(handler), base_url=_BASE_URL + ), + **options, + ) + + +class TestTypedMethodErrorBodies: + @pytest.mark.parametrize( + "response", + [ + httpx.Response(503, text="Service Unavailable"), + httpx.Response(503, json={"message": "upstream down"}), + httpx.Response( + 503, + json={"error": {"code": "database_unavailable", "message": "retry"}}, + ), + ], + ids=["html", "foreign-json", "documented-body"], + ) + def test_a_503_is_a_status_error_whatever_its_body( + self, response: httpx.Response + ) -> None: + client = _typed_client(lambda req: response) + with pytest.raises(seclai.SeclaiAPIStatusError) as exc: + client.list_sources() + assert exc.value.status_code == 503 + assert exc.value.response_text + + def test_a_422_with_a_string_detail_is_a_status_error(self) -> None: + client = _typed_client(lambda req: httpx.Response(422, json={"detail": "no"})) + with pytest.raises(seclai.SeclaiAPIStatusError) as exc: + client.list_sources() + assert exc.value.status_code == 422 + assert not isinstance(exc.value, seclai.SeclaiAPIValidationError) + + def test_a_422_with_field_detail_is_a_validation_error(self) -> None: + client = _typed_client(lambda req: httpx.Response(422, json=_FIELD_DETAIL)) + with pytest.raises(seclai.SeclaiAPIValidationError) as exc: + client.list_sources() + assert exc.value.validation_error is not None + + def test_an_upload_422_with_a_string_detail_is_a_status_error(self) -> None: + client = _typed_client(lambda req: httpx.Response(422, json={"detail": "no"})) + with pytest.raises(seclai.SeclaiAPIStatusError) as exc: + client.upload_file_to_source("s1", file=b"x", file_name="a.txt") + assert exc.value.status_code == 422 + + def test_a_success_still_decodes(self) -> None: + body = { + "data": [], + "pagination": { + "page": 1, + "limit": 20, + "total": 0, + "pages": 0, + "has_next": False, + "has_prev": False, + }, + } + client = _typed_client(lambda req: httpx.Response(200, json=body)) + assert client.list_sources().data == [] + + @pytest.mark.asyncio + async def test_async_503_html_is_a_status_error(self) -> None: + client = AsyncSeclai(api_key="k") + client._generated_client().set_async_httpx_client( + httpx.AsyncClient( + transport=httpx.MockTransport( + lambda req: httpx.Response(503, text="down") + ), + base_url=_BASE_URL, + ) + ) + with pytest.raises(seclai.SeclaiAPIStatusError) as exc: + await client.list_sources() + assert exc.value.status_code == 503 + + +class TestPaginateGuards: + def test_the_legacy_key_also_reads_the_canonical_envelope(self) -> None: + client = _request_client( + lambda req: httpx.Response(200, json={"data": [{"id": "c1"}]}) + ) + items = list(client.paginate("GET", "/alerts/configs", items_key="configs")) + assert items == [{"id": "c1"}] + + def test_the_legacy_key_is_still_read(self) -> None: + client = _request_client( + lambda req: httpx.Response(200, json={"configs": [{"id": "c1"}]}) + ) + items = list(client.paginate("GET", "/alerts/configs", items_key="configs")) + assert items == [{"id": "c1"}] + + def test_an_unreadable_shape_raises_instead_of_yielding_nothing(self) -> None: + client = _request_client( + lambda req: httpx.Response(200, json={"rows": [{"id": "c1"}]}) + ) + with pytest.raises(seclai.SeclaiError): + list(client.paginate("GET", "/alerts/configs", items_key="configs")) + + def test_an_unknown_param_style_is_refused(self) -> None: + requests: list[httpx.Request] = [] + + def handler(req: httpx.Request) -> httpx.Response: + requests.append(req) + return httpx.Response(200, json={"data": []}) + + client = _request_client(handler) + with pytest.raises(ValueError, match="param_style"): + list( + client.paginate( + "GET", + "/models/alerts", + param_style="Offset", # type: ignore[arg-type] + ) + ) + assert requests == [] + + +class TestPerRequestVersionHeader: + def test_an_unknown_version_is_refused(self) -> None: + requests: list[httpx.Request] = [] + + def handler(req: httpx.Request) -> httpx.Response: + requests.append(req) + return httpx.Response(200, json={"data": []}) + + client = _request_client(handler) + with pytest.raises(seclai.SeclaiConfigurationError, match="2099-01-01"): + client.request("GET", "/agents", headers={"seclai-version": "2099-01-01"}) + assert requests == [] + + def test_an_unknown_version_is_refused_on_a_streaming_method(self) -> None: + client = _request_client(lambda req: httpx.Response(200, text="")) + with pytest.raises(seclai.SeclaiConfigurationError, match="2099-01-01"): + client.run_streaming_agent_and_wait( + "a1", + AgentRunStreamRequest(input="hi", metadata={}), + headers={"Seclai-Version": "2099-01-01"}, + ) + + def test_the_escape_hatch_allows_it(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["version"] = req.headers.get("seclai-version") + return httpx.Response(200, json={"data": []}) + + client = _request_client(handler, allow_unknown_api_version=True) + client.request("GET", "/agents", headers={"Seclai-Version": "2099-01-01"}) + assert seen["version"] == "2099-01-01" + + def test_a_known_version_still_overrides(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["version"] = req.headers.get("seclai-version") + return httpx.Response(200, json={"data": []}) + + client = _request_client(handler, api_version="2026-07-01") + client.request("GET", "/agents", headers={"Seclai-Version": "2026-10-03"}) + assert seen["version"] == "2026-10-03" From 140ad886af2d1f2832901c2fff3a837bf0b1cb3d Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Sun, 4 Oct 2026 17:41:38 -0700 Subject: [PATCH 5/6] Fixed review findings --- README.md | 7 ++- seclai/seclai.py | 78 ++++++++++++++++------------- tests/test_error_and_guard_paths.py | 25 +++++++++ 3 files changed, 72 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index f225e60..e6a2859 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,9 @@ 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 +The guard covers the header however it is supplied — `api_version`, +`default_headers`, or a per-request `headers` argument — and nothing else. 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. @@ -765,7 +767,8 @@ All list methods accept `page` and `limit` parameters. For auto-pagination acros for agent in client.paginate("GET", "/agents"): print(agent["name"]) -# With a custom items key, for an endpoint still on a per-resource key +# With a per-resource items key; `data` is read first, so this works on +# either response shape for config in client.paginate("GET", "/alerts/configs", items_key="configs"): print(config["id"]) diff --git a/seclai/seclai.py b/seclai/seclai.py index 00536e1..5fe4377 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -430,13 +430,7 @@ async def _merge_request_headers_async( 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. - """ + """Raise on a non-success status, `SeclaiAPIValidationError` for a 422.""" if 200 <= response.status_code < 400: return try: @@ -496,15 +490,20 @@ def _validate_request_version( options: ClientOptions, request_headers: Mapping[str, str] | None ) -> None: """Apply the unknown-version guard to a per-request ``Seclai-Version``.""" - for key, value in (request_headers or {}).items(): - if key.lower() != "seclai-version": - continue - try: - validate_api_version(value, allow_unknown=options.allow_unknown_api_version) - except ValueError as e: - raise SeclaiConfigurationError( - f"{e} (via headers['Seclai-Version'])" - ) from e + # The last spelling is the one `_merge_headers` leaves on the wire. + versions = [ + value + for key, value in (request_headers or {}).items() + if key.lower() == "seclai-version" + ] + if not versions: + return + try: + validate_api_version( + versions[-1], allow_unknown=options.allow_unknown_api_version + ) + except ValueError as e: + raise SeclaiConfigurationError(f"{e} (via headers['Seclai-Version'])") from e class _SeclaiBase: @@ -643,8 +642,9 @@ def _default_headers(self) -> dict[str, str]: 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. + Used by the wrapper methods in this file. Once one of them has run, the + client's httpx client raises `SeclaiAPIStatusError` for a 4xx/5xx rather + than returning it to a generated request helper. """ if self._generated_client_instance is None: self._generated_client_instance = GeneratedClient( @@ -655,11 +655,10 @@ def _generated_client(self) -> GeneratedClient: return self._generated_client_instance def _sync_generated_client(self) -> GeneratedClient: - """Return the generated client with dynamic auth headers applied (sync). + """Return the generated client, ready to send (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`. + Resolves fresh auth headers for the ``bearer_provider`` and ``sso`` modes, + and makes its httpx client raise through :func:`_raise_for_status`. """ gc = self._generated_client() if self._options.auth_state.mode in ("bearer_provider", "sso"): @@ -689,11 +688,10 @@ def _sync_generated_client(self) -> GeneratedClient: return client async def _async_generated_client(self) -> GeneratedClient: - """Return the generated client with dynamic auth headers applied (async). + """Return the generated client, ready to send (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`. + Resolves fresh auth headers for the ``bearer_provider`` and ``sso`` modes, + and makes its httpx client raise through :func:`_raise_for_status`. """ gc = self._generated_client() if self._options.auth_state.mode in ("bearer_provider", "sso"): @@ -4812,7 +4810,8 @@ def paginate( params: Extra query parameters (the cursor and ``limit`` are managed automatically). limit: Items per page. - items_key: JSON key containing the list of items (default ``"data"``). + items_key: Per-resource key the items sit under when the response + is not the ``data`` envelope, which is always read first. param_style: ``"page"`` (default) sends a 1-indexed ``page``; ``"offset"`` sends a 0-based ``offset``. A few endpoints — ``/models/alerts`` among them — declare only ``offset`` and @@ -4821,6 +4820,11 @@ def paginate( Yields: Individual item dicts from each page. + + Raises: + ValueError: If ``param_style`` is neither ``"page"`` nor ``"offset"``. + SeclaiError: If a page is neither a list nor an object carrying + ``data`` or ``items_key``. """ if param_style not in ("page", "offset"): raise ValueError( @@ -4835,10 +4839,8 @@ def paginate( base_params["page"] = page base_params["limit"] = limit result = self.request(method, path, params=base_params) - # A bare array is the legacy, unpaginated shape of the version-gated - # list endpoints (evaluation criteria and run evaluation results). - # It carries everything in one response, so yield it and stop rather - # than silently reporting no results. + # A bare array is an unpaginated response: it is everything, so + # asking for a second page would return the same items again. if isinstance(result, list): for item in result: yield cast(dict[str, Any], item) @@ -9100,7 +9102,8 @@ async def paginate( params: Extra query parameters (the cursor and ``limit`` are managed automatically). limit: Items per page. - items_key: JSON key containing the list of items (default ``"data"``). + items_key: Per-resource key the items sit under when the response + is not the ``data`` envelope, which is always read first. param_style: ``"page"`` (default) sends a 1-indexed ``page``; ``"offset"`` sends a 0-based ``offset``. A few endpoints — ``/models/alerts`` among them — declare only ``offset`` and @@ -9109,6 +9112,11 @@ async def paginate( Yields: Individual items from each page. + + Raises: + ValueError: If ``param_style`` is neither ``"page"`` nor ``"offset"``. + SeclaiError: If a page is neither a list nor an object carrying + ``data`` or ``items_key``. """ if param_style not in ("page", "offset"): raise ValueError( @@ -9123,10 +9131,8 @@ async def paginate( base_params["page"] = page base_params["limit"] = limit result = await self.request(method, path, params=base_params) - # A bare array is the legacy, unpaginated shape of the version-gated - # list endpoints (evaluation criteria and run evaluation results). - # It carries everything in one response, so yield it and stop rather - # than silently reporting no results. + # A bare array is an unpaginated response: it is everything, so + # asking for a second page would return the same items again. if isinstance(result, list): for item in result: yield cast(dict[str, Any], item) diff --git a/tests/test_error_and_guard_paths.py b/tests/test_error_and_guard_paths.py index 9af825d..1aa5cba 100644 --- a/tests/test_error_and_guard_paths.py +++ b/tests/test_error_and_guard_paths.py @@ -191,3 +191,28 @@ def handler(req: httpx.Request) -> httpx.Response: client = _request_client(handler, api_version="2026-07-01") client.request("GET", "/agents", headers={"Seclai-Version": "2026-10-03"}) assert seen["version"] == "2026-10-03" + + def test_the_spelling_that_reaches_the_wire_is_the_one_checked(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["versions"] = req.headers.get_list("seclai-version") + return httpx.Response(200, json={"data": []}) + + client = _request_client(handler) + client.request( + "GET", + "/agents", + headers={"seclai-version": "2099-01-01", "Seclai-Version": "2026-10-03"}, + ) + assert seen["versions"] == ["2026-10-03"] + + with pytest.raises(seclai.SeclaiConfigurationError, match="2099-01-01"): + client.request( + "GET", + "/agents", + headers={ + "Seclai-Version": "2026-10-03", + "seclai-version": "2099-01-01", + }, + ) From bdac40d4a10aa1e7b5013dba1ee6e37eb74b081f Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Sun, 4 Oct 2026 20:41:26 -0700 Subject: [PATCH 6/6] Updated list source content description --- openapi/seclai.openapi.json | 4 +- ...urces_source_connection_id_contents_get.py | 24 +- seclai/seclai.py | 8 +- uv.lock | 255 ++++++++++++++++++ 4 files changed, 279 insertions(+), 12 deletions(-) create mode 100644 uv.lock diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 3d86fdc..058d09e 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -25255,7 +25255,7 @@ } }, { - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. At most 500 ids per request \u2014 beyond that, page through the unfiltered listing or split the poll.", + "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", "in": "query", "name": "content_version_id", "required": false, @@ -25272,7 +25272,7 @@ "type": "null" } ], - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. At most 500 ids per request \u2014 beyond that, page through the unfiltered listing or split the poll.", + "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", "title": "Content Version Id" } }, 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 b2d41a4..e5ad496 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 @@ -172,8 +172,10 @@ def sync_detailed( not be indexed. content_version_id (list[UUID] | None | Unset): Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll - exactly the items you uploaded in a single request. At most 500 ids per request — beyond - that, page through the unfiltered listing or split the poll. + exactly the items you uploaded in a single request. The ids travel in the query string, so + keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches + the API. The API itself accepts at most 500 — beyond either limit, split the poll or page + through the unfiltered listing. x_account_id (UUID | Unset): seclai_version (str | Unset): @@ -259,8 +261,10 @@ def sync( not be indexed. content_version_id (list[UUID] | None | Unset): Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll - exactly the items you uploaded in a single request. At most 500 ids per request — beyond - that, page through the unfiltered listing or split the poll. + exactly the items you uploaded in a single request. The ids travel in the query string, so + keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches + the API. The API itself accepts at most 500 — beyond either limit, split the poll or page + through the unfiltered listing. x_account_id (UUID | Unset): seclai_version (str | Unset): @@ -338,8 +342,10 @@ async def asyncio_detailed( not be indexed. content_version_id (list[UUID] | None | Unset): Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll - exactly the items you uploaded in a single request. At most 500 ids per request — beyond - that, page through the unfiltered listing or split the poll. + exactly the items you uploaded in a single request. The ids travel in the query string, so + keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches + the API. The API itself accepts at most 500 — beyond either limit, split the poll or page + through the unfiltered listing. x_account_id (UUID | Unset): seclai_version (str | Unset): @@ -423,8 +429,10 @@ async def asyncio( not be indexed. content_version_id (list[UUID] | None | Unset): Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll - exactly the items you uploaded in a single request. At most 500 ids per request — beyond - that, page through the unfiltered listing or split the poll. + exactly the items you uploaded in a single request. The ids travel in the query string, so + keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches + the API. The API itself accepts at most 500 — beyond either limit, split the poll or page + through the unfiltered listing. x_account_id (UUID | Unset): seclai_version (str | Unset): diff --git a/seclai/seclai.py b/seclai/seclai.py index 5fe4377..8a1ab8e 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -3245,7 +3245,9 @@ def list_source_contents( ``failed``. content_version_ids: Keep only these items — the ``content_version_id`` values the upload methods return — to - poll a batch of uploads in one request. At most 500. + poll a batch of uploads in one request. Keep it to about 100: + the ids travel in the query string, and a URL over 8,192 bytes + is rejected with a 414. The API itself accepts at most 500. Returns: ``{"data": [...], "pagination": {...}}`` on every API version. An @@ -7503,7 +7505,9 @@ async def list_source_contents( ``failed``. content_version_ids: Keep only these items — the ``content_version_id`` values the upload methods return — to - poll a batch of uploads in one request. At most 500. + poll a batch of uploads in one request. Keep it to about 100: + the ids travel in the query string, and a URL over 8,192 bytes + is rejected with a 414. The API itself accepts at most 500. Returns: ``{"data": [...], "pagination": {...}}`` on every API version. An diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..da3ce9a --- /dev/null +++ b/uv.lock @@ -0,0 +1,255 @@ +version = 1 +revision = 3 +requires-python = ">=3.11, <4.0" + +[[package]] +name = "annotated-types" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, +] + +[[package]] +name = "anyio" +version = "4.15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.15'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750, upload-time = "2026-08-28T14:04:00.916Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589, upload-time = "2026-08-28T14:03:59.136Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.46.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262, upload-time = "2026-08-28T10:01:31.677Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/b6/81d2d19ea0be2c03664381b59f65fa72fc7969decedae00bc2c4ad835708/pydantic_core-2.46.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f", size = 2074737, upload-time = "2026-08-28T09:57:57.711Z" }, + { url = "https://files.pythonhosted.org/packages/0c/18/b70da8300e292df4099684ea11b1958043580d2f50d2dc8bf7e542bdd84a/pydantic_core-2.46.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f", size = 1921751, upload-time = "2026-08-28T09:57:59.265Z" }, + { url = "https://files.pythonhosted.org/packages/e7/1a/0d590341b6ffa4b4aca83508e6b8db4761aaeacfc15a25ca3815876d4797/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061", size = 1948231, upload-time = "2026-08-28T09:58:00.678Z" }, + { url = "https://files.pythonhosted.org/packages/7d/1d/02eb35761c51f2f7b1b042d6ab4cda6600f0c8c88a2243b3f734376201e5/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be", size = 2020708, upload-time = "2026-08-28T09:58:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ea/f86073830e35d508cc8ddf9c3d9e6e6840fcb88d34bf726b0b4710186f27/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a", size = 2194914, upload-time = "2026-08-28T09:58:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/bb/d7/fc36240d7791ce90939e51608568c33bfdae26202016f9770c229a487d86/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b", size = 2235622, upload-time = "2026-08-28T09:58:05.516Z" }, + { url = "https://files.pythonhosted.org/packages/cf/bc/3fa2d76b83162820a17da7f645b28d1cba99fc8e1e5fc6517067ec450fa1/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c", size = 2062091, upload-time = "2026-08-28T09:58:07.135Z" }, + { url = "https://files.pythonhosted.org/packages/ab/9a/095d557bb492c90cd8a70a6dd048bf793d433d03d86c81c11e912e4cd049/pydantic_core-2.46.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee", size = 2089904, upload-time = "2026-08-28T09:58:08.814Z" }, + { url = "https://files.pythonhosted.org/packages/24/98/7b76b1ad10a19a617a52aaa1d80e159115af939b095e86f8e756fd52e0df/pydantic_core-2.46.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e", size = 2132244, upload-time = "2026-08-28T09:58:10.435Z" }, + { url = "https://files.pythonhosted.org/packages/20/32/7d6ca365fadba186a0c8f85de1a701663bce81efd309d9479be58687622f/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2", size = 2143901, upload-time = "2026-08-28T09:58:12.033Z" }, + { url = "https://files.pythonhosted.org/packages/f8/09/eb9a6aa57f22fd1541a9c0aa2a1f3aeef3ec65347d33e10a6da2f43e0ee9/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689", size = 2299425, upload-time = "2026-08-28T09:58:13.614Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f9/548a5bb9d4ba8cd26e26daf48052236f6b38bb61e7b7241fbc3c995719eb/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec", size = 2318566, upload-time = "2026-08-28T09:58:15.199Z" }, + { url = "https://files.pythonhosted.org/packages/4a/20/06454d18834c02c406c9133f1a3b485305fd9ee984f9636c2f730bef6a9d/pydantic_core-2.46.5-cp311-cp311-win32.whl", hash = "sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129", size = 1954258, upload-time = "2026-08-28T09:58:16.813Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c2/718b9deb4b72453b5d8c7447a3b14cb77bef36917ef5f514e0948a4096a0/pydantic_core-2.46.5-cp311-cp311-win_amd64.whl", hash = "sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c", size = 2041030, upload-time = "2026-08-28T09:58:18.288Z" }, + { url = "https://files.pythonhosted.org/packages/67/ea/c1d1a5b72d6e1ff7f377a4d9199f6591f095beb5b409a8a5d89f7238d939/pydantic_core-2.46.5-cp311-cp311-win_arm64.whl", hash = "sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8", size = 2009234, upload-time = "2026-08-28T09:58:19.929Z" }, + { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516, upload-time = "2026-08-28T09:58:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874, upload-time = "2026-08-28T09:58:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772, upload-time = "2026-08-28T09:58:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832, upload-time = "2026-08-28T09:58:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645, upload-time = "2026-08-28T09:58:28.948Z" }, + { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935, upload-time = "2026-08-28T09:58:30.625Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284, upload-time = "2026-08-28T09:58:32.289Z" }, + { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889, upload-time = "2026-08-28T09:58:33.986Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006, upload-time = "2026-08-28T09:58:35.647Z" }, + { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408, upload-time = "2026-08-28T09:58:37.38Z" }, + { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609, upload-time = "2026-08-28T09:58:39.22Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618, upload-time = "2026-08-28T09:58:40.89Z" }, + { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475, upload-time = "2026-08-28T09:58:42.591Z" }, + { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140, upload-time = "2026-08-28T09:58:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729, upload-time = "2026-08-28T09:58:46.13Z" }, + { url = "https://files.pythonhosted.org/packages/f5/37/5abe39a8372a61d3dc3c1338fc504281c01b32fdb3169cd7187153b56d3e/pydantic_core-2.46.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:b7ca9034437b6022f941f4857459562ee00a560b97e7cce8a0ec5a74fc6766e0", size = 2075885, upload-time = "2026-08-28T09:58:47.856Z" }, + { url = "https://files.pythonhosted.org/packages/21/43/6323b1f8b217780454c61304bcd2b38ae4762f50754414124603ccc90bb2/pydantic_core-2.46.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f332f0e72a5a0400141f830744e141bf9f97917878dbe968669e8a7fefea78ff", size = 1922768, upload-time = "2026-08-28T09:58:49.58Z" }, + { url = "https://files.pythonhosted.org/packages/0f/a3/c05ca796e1197618a774b01e596aeedfefc2f7d8c01ae3054e910b120e8a/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:193375f3548919d3f0b60936ca113ada3e38f264f91b9b8e0508efaad57be931", size = 1951241, upload-time = "2026-08-28T09:58:51.511Z" }, + { url = "https://files.pythonhosted.org/packages/68/32/33bc39ac705c52cffc908e8389f9754fdb208aea5c69cceddf4eb3ce99af/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:79bdfa52f843137045b2d081cc05c120ba6665d29b7559c2c47690906f39279f", size = 2031975, upload-time = "2026-08-28T09:58:53.166Z" }, + { url = "https://files.pythonhosted.org/packages/b0/70/2333e885c0f6a67bc105c5916965dac9b57f2718ee20d81d1a06a4ebdc13/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:24922243639cbdac66c75fcb6fd6495a9cb52b213d62f9a0d16f0310b1ff8038", size = 2208542, upload-time = "2026-08-28T09:58:55.017Z" }, + { url = "https://files.pythonhosted.org/packages/f7/ea/296debfb4264207bbda5936133892e027c0a58875ad53ebd512fba8ec3a2/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c76fe65e607be28c7fd4d56fc3c42b1583aa058ce3408b7ad0fd540171d31f9f", size = 2264692, upload-time = "2026-08-28T09:58:56.767Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f2/9e4de77a6271e07a76d2d58b11c091a979c191ed2939bf80067568b369d2/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f7b393a8b3da82f5c1fc0751e6d01ac6c55b93c18226a60bdfba4a724efafd1", size = 2066633, upload-time = "2026-08-28T09:58:58.531Z" }, + { url = "https://files.pythonhosted.org/packages/8d/db/f9e9d0c97445987b2084823d5c240de88087338f04fc2cfaa2df186b8049/pydantic_core-2.46.5-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:7ac031912d54f3d83ef3b3eb98dfabc1608802e2202263d25957eeed40b94761", size = 2105235, upload-time = "2026-08-28T09:59:00.421Z" }, + { url = "https://files.pythonhosted.org/packages/07/c5/79169b047b3b2c3e99e04bc76372af9637e0bf6db638274fa927df96369e/pydantic_core-2.46.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:837b396ca3d7b74091ca623f6cbd8351bd42d670a79c2683e79fb089f06a2de5", size = 2157367, upload-time = "2026-08-28T09:59:02.442Z" }, + { url = "https://files.pythonhosted.org/packages/26/b5/ba6057afb7c291bd449f51b867f95aef2072941c4ce4e5c31d6ffd132d3b/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:5ee239d575f80b08eca11f6e20f90c4c695de7825c67eefe6091fbf20dda648e", size = 2158420, upload-time = "2026-08-28T09:59:04.2Z" }, + { url = "https://files.pythonhosted.org/packages/6e/28/2057abecaafdc22912afa819603a51f0a62d40643b7c4871c51721fea9be/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:e80675d75ae2cd14372cb65cad5400d9347a3d3f6c13000183f22dfd027283ed", size = 2309588, upload-time = "2026-08-28T09:59:06.048Z" }, + { url = "https://files.pythonhosted.org/packages/71/9d/881156dc404e27479c4246128d73538464cab4a239bec61995e227644c30/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:9c4b71f10dd532fb7a5cbc8f58707779e64f03a258c2bf8bfbaecfcd9970b519", size = 2341866, upload-time = "2026-08-28T09:59:08.539Z" }, + { url = "https://files.pythonhosted.org/packages/5a/38/d66f443a259f84d13babdceae568e572b0ed26da17ca5d0a649ebb110a67/pydantic_core-2.46.5-cp313-cp313-win32.whl", hash = "sha256:97bf8de4d541598c94a59344eeb988a94c08ff76b5723c41f6567ec18c7892ea", size = 1938580, upload-time = "2026-08-28T09:59:10.402Z" }, + { url = "https://files.pythonhosted.org/packages/2c/1e/1d5371213f4cc9a7ed70c0bfcc7911de22311ee99a662a56077d7292d2ac/pydantic_core-2.46.5-cp313-cp313-win_amd64.whl", hash = "sha256:15f4a94963c95accac15b7b657bb177d3ad82bb90b0d0526d9a9b85079925db5", size = 2041980, upload-time = "2026-08-28T09:59:12.396Z" }, + { url = "https://files.pythonhosted.org/packages/5a/48/4222d90b1c67568bace4dec6dca6271449c66de3595d72b6d098f5fde597/pydantic_core-2.46.5-cp313-cp313-win_arm64.whl", hash = "sha256:d22a945598fb91236b4dd793a6e42e4f3dd7740bb5aace5ebd7d4c08d13bb575", size = 1997213, upload-time = "2026-08-28T09:59:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/8e/8a/14596f2a8367da50cf7cbac48169ee5d9c8e11d486a3b527082384630c72/pydantic_core-2.46.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c1c43ad4339643d70ebb8124e1305a7dab423001eff58bb41a0f731adbc98355", size = 2074081, upload-time = "2026-08-28T09:59:16.141Z" }, + { url = "https://files.pythonhosted.org/packages/ae/d5/d8a4eb6d6c7f66b91dd37c576d76e9e60fba900caf5372c17bcf949febc2/pydantic_core-2.46.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1a353f84de772f423b5ffb11d7ae352fbbef0f446f3c0b0af0f8236d7233606e", size = 1920497, upload-time = "2026-08-28T09:59:18.065Z" }, + { url = "https://files.pythonhosted.org/packages/8e/26/092079428f86e927e030b2c0ced87df69dbb1c875cdeaa67bf42ea2be746/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5086029a57366b8cf81b130a43908738095c270c21a8d7f0e8bdfdb89718e2f3", size = 1952130, upload-time = "2026-08-28T09:59:20.476Z" }, + { url = "https://files.pythonhosted.org/packages/08/c3/8ec0e290a9ebaebd64047bf5fda94be835c6b1551b02437e4b76778fbcd7/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46c25dda9d092a06c08db76ffe0a197107904d0dfac653f7d5306bbcd6d6119c", size = 2026371, upload-time = "2026-08-28T09:59:22.227Z" }, + { url = "https://files.pythonhosted.org/packages/01/72/4fd20ad520fb8da0157f95b27a7eb05a72790ef08138e7701ac972c342ea/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:37ea7b83c935e5b0d68c9449b82651accf78a10828b2c02b2f2d9e9496446c21", size = 2202822, upload-time = "2026-08-28T09:59:24.277Z" }, + { url = "https://files.pythonhosted.org/packages/31/b0/d16e0771206b29314f0d52198b720be21e8a99ab2bf11e3bc0d7c9cebdff/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e64e88d5585bea9ce95861079de72006c7fa6d3df4e3a3b65ba31eb979c15c9f", size = 2262756, upload-time = "2026-08-28T09:59:26.608Z" }, + { url = "https://files.pythonhosted.org/packages/2c/9b/59634b7ac631c63b2a37760eb6943af3e29573d6b59a4abc5e7f019d4cee/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d510bac3ee52247af28ed4bb18a1e799f040ac60fd2bf5ccd4c92f1fbe786f", size = 2068352, upload-time = "2026-08-28T09:59:29.044Z" }, + { url = "https://files.pythonhosted.org/packages/08/7c/570abb1ad2155348dc754ea91be22e5aaa18eb6d69a6068f7c6f2679a6ed/pydantic_core-2.46.5-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:a2a5e1d0ff29adddc9f6d6821a66302e4493f8ca898b715b6b1182c2c201ea0a", size = 2104777, upload-time = "2026-08-28T09:59:30.95Z" }, + { url = "https://files.pythonhosted.org/packages/8e/25/5bf74adc65a1ac5b7be3f6cb0bcb5433615c1598a801c19d830d84c98ded/pydantic_core-2.46.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03b9666e41e35d8909852ba191a0607520f81b74eaf12ccf8737005dbb313821", size = 2156312, upload-time = "2026-08-28T09:59:32.604Z" }, + { url = "https://files.pythonhosted.org/packages/90/6a/2ef38830675e050121040618135564ed56b860b45433b02d9b4ebece46f3/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:a91c17edf6eea2402cb5457b4c89e99bc5ed1004aa34c4adf1d4258c1a5c22c2", size = 2150067, upload-time = "2026-08-28T09:59:34.453Z" }, + { url = "https://files.pythonhosted.org/packages/90/ef/a7dbb03a14a64c2a4621f989c615ed9a892535a6cad938fc27079f919d80/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b49924c73a235e969511bf2aabdff3beebf9820931f646c80274d5d780010c47", size = 2304516, upload-time = "2026-08-28T09:59:36.194Z" }, + { url = "https://files.pythonhosted.org/packages/68/f8/6bb4c4b80e8a6fde1904c64a51c62a1d04fcdfa3ea521a66b2ddefa1d885/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:2cbd9a5eff05e51c447c34dfa4632145b26b09120cf04bd0c871e44c1a5e1c9a", size = 2335223, upload-time = "2026-08-28T09:59:37.931Z" }, + { url = "https://files.pythonhosted.org/packages/2a/80/f46b8c681195190b2c1f1c7c0a81abce60663e987613e09ef64d433dd96b/pydantic_core-2.46.5-cp314-cp314-win32.whl", hash = "sha256:2d5d76654becf5efd62c9e51c3756c67b49498b0c9a40884934c40807adbd074", size = 1934827, upload-time = "2026-08-28T09:59:39.836Z" }, + { url = "https://files.pythonhosted.org/packages/f7/3c/60674207246bc0a4009d2391b7c7251c7159f279c8d2ab8aae8ef46f3dee/pydantic_core-2.46.5-cp314-cp314-win_amd64.whl", hash = "sha256:fa10ef4112775900e7a0661068635eb67b2ab824fbde764de6e0e21982a93db0", size = 2042648, upload-time = "2026-08-28T09:59:41.792Z" }, + { url = "https://files.pythonhosted.org/packages/69/0c/117c562c7c1babdf44576b72a5e496906506c93690387ecfbca7c729ae2e/pydantic_core-2.46.5-cp314-cp314-win_arm64.whl", hash = "sha256:045ab3b6d308439e32b81cc173bba5b9018bc6ed896afd0c65b3b009b1699af5", size = 1989652, upload-time = "2026-08-28T09:59:43.702Z" }, + { url = "https://files.pythonhosted.org/packages/e8/66/9336ae58f9eb68c41d121894e52c4c89eccb07eb8f602a04ee9c3f37736a/pydantic_core-2.46.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8816f3d218beb4b787de5c9759c259b8fa61f9dec42dc7811f320a33771778b7", size = 2065829, upload-time = "2026-08-28T09:59:45.364Z" }, + { url = "https://files.pythonhosted.org/packages/c5/02/bc19b47a96c2d3109760711acf22369e56bd7e405ca52f7ade164d2ead57/pydantic_core-2.46.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:bce57638e08ac148e5778cce7feb968307a727d66f8e2274a543d0cf0c9ad6a3", size = 1905716, upload-time = "2026-08-28T09:59:47.18Z" }, + { url = "https://files.pythonhosted.org/packages/52/a4/70b47c0509923dd98ccfed04fb3e32ea3849c82a0ff2205bb41009b43c00/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:976e1128455aa595ea04c79ccfedff1aaeab96ee013fcc916bed120c4f0ad94f", size = 1934216, upload-time = "2026-08-28T09:59:49.241Z" }, + { url = "https://files.pythonhosted.org/packages/52/ab/aa03b65f7bb198585edf806b906c3223ecf1795543e39e23aec4cce27ad2/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b891faeedeafba41b2983e5001a81b6a915b69544c7e7570d1989ce1c36ac7", size = 2010635, upload-time = "2026-08-28T09:59:51.692Z" }, + { url = "https://files.pythonhosted.org/packages/3c/8b/0da06343f30b84ec549aafd309c6456223d5dc8bd36af504c573faad561d/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f194189415698233dd1114a093a9b56e61e2c57e11b469be3b0506f46f0771c", size = 2209369, upload-time = "2026-08-28T09:59:53.582Z" }, + { url = "https://files.pythonhosted.org/packages/d6/5b/844c4defaa34a3df66eb9257087d121d70c201298b96abdf9f492fc2f1bf/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82a36973cf8a2ef5406f4fe2edbf8ed0c99629535d959e0b100c76a32535a111", size = 2253238, upload-time = "2026-08-28T09:59:55.484Z" }, + { url = "https://files.pythonhosted.org/packages/f4/64/a4e536cb16d7f61a7fd3120b46c577fc7fa7325992f69c4f52bc786d77d8/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdbb78909f52b981d3b2d56b97328d71eb0b974c36bd77c920123a7ebb192829", size = 2065740, upload-time = "2026-08-28T09:59:58.038Z" }, + { url = "https://files.pythonhosted.org/packages/5f/75/aaa38c6bc2d085f6605b34eabdc6a8a4e0b2e61fc9c8e6e52b28e97b3125/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:52e24eacdb536cade636aa90fb851835222becff8484b7001fdc78cb0290f2aa", size = 2087425, upload-time = "2026-08-28T09:59:59.898Z" }, + { url = "https://files.pythonhosted.org/packages/55/ae/fcab4cfc39aba3689e1d20c8b5250ad280957022c09af2ed9cd585602a5e/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:37ae34309d7bd8c0d61ab839668058f2a7962ea1fc51d105d2db228fe0618034", size = 2139306, upload-time = "2026-08-28T10:00:03.057Z" }, + { url = "https://files.pythonhosted.org/packages/2d/f4/f1d03a4bc9d9acbc62f4d742b8a319af52f71885079868b2ff8e48a651ee/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:0cdbada856a1c69a7624a64d3d9aefe79300bd6ef827b43a4f265010b9b55184", size = 2144589, upload-time = "2026-08-28T10:00:05.645Z" }, + { url = "https://files.pythonhosted.org/packages/83/f3/7a53bb1356de514a4cd295f25b6ac39237895620c0462d2592b76c16e114/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:545f26c504b27c3758439a5e6d9349931f0a04f855668d5fe323c89e82300a38", size = 2288882, upload-time = "2026-08-28T10:00:07.931Z" }, + { url = "https://files.pythonhosted.org/packages/cd/94/5a81583660c175c59d49ffb09f4b3a44debeaf86a19fca664ae1cdd9ee32/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:ff218293c9c806138dca139765e3b067621be52bcd93cdc14c7711be7ddc90a9", size = 2335210, upload-time = "2026-08-28T10:00:10.177Z" }, + { url = "https://files.pythonhosted.org/packages/5a/9f/5d685c2693b972d1a59c998586e8823712b66603aeff47ee60a4bdaafd37/pydantic_core-2.46.5-cp314-cp314t-win32.whl", hash = "sha256:97cf3eb53a8cccacf9d46686a0926186c9bfb5574f2ed66d3639d5fe117cd3a9", size = 1921180, upload-time = "2026-08-28T10:00:12.35Z" }, + { url = "https://files.pythonhosted.org/packages/70/12/5c94ee16d65a37a15f9e869f5e6256df111154491173801a4c5e800ab548/pydantic_core-2.46.5-cp314-cp314t-win_amd64.whl", hash = "sha256:d2f9fc07a8042a8f95925b35c4f04f469707c981fc33245b6ca187cf5d2dd290", size = 2020515, upload-time = "2026-08-28T10:00:14.774Z" }, + { url = "https://files.pythonhosted.org/packages/63/19/67830dda664e6bdf9285ee2e40f355d0d7d6b92aa0c42e8d217bb8d33d36/pydantic_core-2.46.5-cp314-cp314t-win_arm64.whl", hash = "sha256:acf8a67ba51f4ca9ddbd0e6b3000a65ac51ab734661778b3e7ba64d99a710f2f", size = 1989276, upload-time = "2026-08-28T10:00:16.984Z" }, + { url = "https://files.pythonhosted.org/packages/af/1e/ecca01fce348f7e8afa9572441ff6f7d1cc70d21e4859f33944d10877e1e/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2", size = 2075342, upload-time = "2026-08-28T10:00:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/1f/4c/af80c7a8032dfc897040ad5cb772bebde529a381186499e6e29987f23f8c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c", size = 1907219, upload-time = "2026-08-28T10:00:53.438Z" }, + { url = "https://files.pythonhosted.org/packages/be/3e/54d89e2b092e778716bf6153634ef479e955f48c261090be23aa1e0fb0b5/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47", size = 1953393, upload-time = "2026-08-28T10:00:55.58Z" }, + { url = "https://files.pythonhosted.org/packages/ea/89/828ee90cda28ce17bdefaa3a6eaf74fe430e113295a10e6126beca559d6c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a", size = 2099024, upload-time = "2026-08-28T10:00:57.794Z" }, + { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540, upload-time = "2026-08-28T10:01:00.318Z" }, + { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040, upload-time = "2026-08-28T10:01:02.529Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479, upload-time = "2026-08-28T10:01:05.004Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034, upload-time = "2026-08-28T10:01:07.345Z" }, + { url = "https://files.pythonhosted.org/packages/20/21/22102e9950b3049526d20e811b95396508377d87651edd2b80d2b3d28659/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f", size = 2071333, upload-time = "2026-08-28T10:01:09.636Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/87aefa427d191e6d3ab1447f1efc1cdcac86af1069239b133e8a0fd7f7c9/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0", size = 1912713, upload-time = "2026-08-28T10:01:12.285Z" }, + { url = "https://files.pythonhosted.org/packages/1f/93/fd89e9ad49b1805ca94d24ce1088b7d305f05c35ffafcedb9819d03588a0/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4", size = 2090926, upload-time = "2026-08-28T10:01:15.19Z" }, + { url = "https://files.pythonhosted.org/packages/6f/45/8e59dab6acf8d35f02f0a958980074f31038968bdb2c983fcae9d1efee03/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25", size = 2131303, upload-time = "2026-08-28T10:01:17.937Z" }, + { url = "https://files.pythonhosted.org/packages/d5/a5/e1d4dc5180dd887a9522efc1f8716b8692b7606b1d3273d7862eaf66be44/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6", size = 2145128, upload-time = "2026-08-28T10:01:20.694Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d7/ad493864a7fb21c0c4df98f965e2db430cb25a9d7369b5778d5016c09fd9/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e", size = 2294560, upload-time = "2026-08-28T10:01:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/b41c84c913f29973a268e6c2b5bbf13c95adb9956c126d10da11ba3b2bef/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda", size = 2317531, upload-time = "2026-08-28T10:01:26.334Z" }, + { url = "https://files.pythonhosted.org/packages/db/1d/068464f23075f66a8f1b806935e9cd9363ee446636ea70d2c22ee8659dbf/pydantic_core-2.46.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266", size = 2140686, upload-time = "2026-08-28T10:01:28.947Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "seclai" +source = { editable = "." } +dependencies = [ + { name = "httpx" }, + { name = "pydantic" }, + { name = "python-dateutil" }, +] + +[package.metadata] +requires-dist = [ + { name = "httpx", specifier = ">=0.28.1,<0.29.0" }, + { name = "pydantic", specifier = ">=2.12.5,<3.0.0" }, + { name = "python-dateutil", specifier = ">=2.8.1,<3.0.0" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" }, +]