oci 2.151.0__py3-none-any.whl → 2.152.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. oci/__init__.py +2 -2
  2. oci/access_governance_cp/access_governance_cp_client.py +8 -8
  3. oci/addons/__init__.py +20 -0
  4. oci/addons/adk/__init__.py +13 -0
  5. oci/addons/adk/agent.py +852 -0
  6. oci/addons/adk/agent_client.py +682 -0
  7. oci/addons/adk/agent_error.py +36 -0
  8. oci/addons/adk/auth/__init__.py +5 -0
  9. oci/addons/adk/auth/auth_provider.py +28 -0
  10. oci/addons/adk/auth/factory.py +78 -0
  11. oci/addons/adk/auth/oci/__init__.py +5 -0
  12. oci/addons/adk/auth/oci/instance_principal.py +53 -0
  13. oci/addons/adk/auth/oci/resource_principal.py +53 -0
  14. oci/addons/adk/auth/oci/session.py +91 -0
  15. oci/addons/adk/auth/oci/user_principal.py +64 -0
  16. oci/addons/adk/constants.py +17 -0
  17. oci/addons/adk/logger.py +163 -0
  18. oci/addons/adk/run/__init__.py +5 -0
  19. oci/addons/adk/run/response.py +56 -0
  20. oci/addons/adk/run/types.py +32 -0
  21. oci/addons/adk/tool/__init__.py +13 -0
  22. oci/addons/adk/tool/function_tool.py +334 -0
  23. oci/addons/adk/tool/prebuilt/__init__.py +8 -0
  24. oci/addons/adk/tool/prebuilt/agentic_rag_tool.py +49 -0
  25. oci/addons/adk/tool/prebuilt/calculator_toolkit.py +104 -0
  26. oci/addons/adk/tool/tool.py +37 -0
  27. oci/addons/adk/tool/toolkit.py +189 -0
  28. oci/addons/adk/tool/utils.py +120 -0
  29. oci/addons/adk/util.py +325 -0
  30. oci/adm/application_dependency_management_client.py +36 -36
  31. oci/ai_anomaly_detection/anomaly_detection_client.py +36 -36
  32. oci/ai_document/ai_service_document_client.py +26 -26
  33. oci/ai_language/ai_service_language_client.py +44 -44
  34. oci/ai_speech/ai_service_speech_client.py +19 -19
  35. oci/ai_vision/ai_service_vision_client.py +28 -28
  36. oci/analytics/analytics_client.py +24 -24
  37. oci/announcements_service/announcement_client.py +5 -5
  38. oci/announcements_service/announcement_subscription_client.py +9 -9
  39. oci/announcements_service/announcements_preferences_client.py +4 -4
  40. oci/announcements_service/service_client.py +1 -1
  41. oci/apigateway/api_gateway_client.py +21 -21
  42. oci/apigateway/deployment_client.py +6 -6
  43. oci/apigateway/gateway_client.py +6 -6
  44. oci/apigateway/subscribers_client.py +6 -6
  45. oci/apigateway/usage_plans_client.py +6 -6
  46. oci/apigateway/work_requests_client.py +5 -5
  47. oci/apm_config/config_client.py +12 -12
  48. oci/apm_control_plane/apm_domain_client.py +14 -14
  49. oci/apm_synthetics/apm_synthetic_client.py +28 -28
  50. oci/apm_traces/attributes_client.py +8 -8
  51. oci/apm_traces/query_client.py +2 -2
  52. oci/apm_traces/trace_client.py +4 -4
  53. oci/appmgmt_control/appmgmt_control_client.py +8 -8
  54. oci/artifacts/artifacts_client.py +32 -32
  55. oci/audit/audit_client.py +3 -3
  56. oci/autoscaling/auto_scaling_client.py +11 -11
  57. oci/bastion/bastion_client.py +15 -15
  58. oci/bds/bds_client.py +84 -84
  59. oci/blockchain/blockchain_platform_client.py +27 -27
  60. oci/budget/budget_client.py +10 -10
  61. oci/capacity_management/capacity_management_client.py +32 -32
  62. oci/certificates/certificates_client.py +5 -5
  63. oci/certificates_management/certificates_management_client.py +32 -32
  64. oci/cims/incident_client.py +6 -6
  65. oci/cloud_bridge/common_client.py +5 -5
  66. oci/cloud_bridge/discovery_client.py +15 -15
  67. oci/cloud_bridge/inventory_client.py +16 -16
  68. oci/cloud_bridge/ocb_agent_svc_client.py +23 -23
  69. oci/cloud_guard/cloud_guard_client.py +155 -155
  70. oci/cloud_migrations/migration_client.py +43 -43
  71. oci/cluster_placement_groups/cluster_placement_groups_cp_client.py +13 -13
  72. oci/compute_cloud_at_customer/compute_cloud_at_customer_client.py +12 -12
  73. oci/compute_instance_agent/compute_instance_agent_client.py +6 -6
  74. oci/compute_instance_agent/plugin_client.py +2 -2
  75. oci/compute_instance_agent/pluginconfig_client.py +1 -1
  76. oci/container_engine/container_engine_client.py +46 -46
  77. oci/container_instances/container_instance_client.py +18 -18
  78. oci/core/blockstorage_client.py +60 -60
  79. oci/core/compute_client.py +117 -117
  80. oci/core/compute_management_client.py +32 -32
  81. oci/core/virtual_network_client.py +258 -258
  82. oci/dashboard_service/dashboard_client.py +6 -6
  83. oci/dashboard_service/dashboard_group_client.py +6 -6
  84. oci/data_catalog/data_catalog_client.py +149 -149
  85. oci/data_flow/data_flow_client.py +45 -45
  86. oci/data_integration/data_integration_client.py +163 -163
  87. oci/data_labeling_service/data_labeling_management_client.py +17 -17
  88. oci/data_labeling_service_dataplane/data_labeling_client.py +15 -15
  89. oci/data_safe/data_safe_client.py +317 -317
  90. oci/data_science/data_science_client.py +145 -145
  91. oci/database/database_client.py +745 -469
  92. oci/database/models/__init__.py +2 -0
  93. oci/database/models/autonomous_db_version_summary.py +31 -0
  94. oci/database/models/backup.py +4 -2
  95. oci/database/models/backup_summary.py +4 -2
  96. oci/database/models/create_external_backup_job_details.py +4 -4
  97. oci/database/models/db_system.py +4 -2
  98. oci/database/models/db_system_summary.py +4 -2
  99. oci/database/models/db_system_upgrade_summary.py +152 -0
  100. oci/database/models/external_container_database.py +4 -2
  101. oci/database/models/external_container_database_summary.py +4 -2
  102. oci/database/models/external_database_base.py +4 -2
  103. oci/database/models/external_non_container_database.py +4 -2
  104. oci/database/models/external_non_container_database_summary.py +4 -2
  105. oci/database/models/external_pluggable_database.py +4 -2
  106. oci/database/models/external_pluggable_database_summary.py +4 -2
  107. oci/database_management/db_management_client.py +356 -230
  108. oci/database_management/db_management_client_composite_operations.py +44 -0
  109. oci/database_management/diagnosability_client.py +4 -4
  110. oci/database_management/managed_my_sql_databases_client.py +7 -247
  111. oci/database_management/models/__init__.py +0 -4
  112. oci/database_management/models/database_diagnostics_and_management_feature_details.py +35 -4
  113. oci/database_management/models/disable_database_management_feature_details.py +33 -2
  114. oci/database_management/models/disable_external_container_database_management_feature_details.py +33 -2
  115. oci/database_management/models/discovered_external_database.py +64 -2
  116. oci/database_management/models/exadata_infrastructure_lifecycle_state_values.py +40 -36
  117. oci/database_management/models/external_database_diagnostics_and_management_feature_details.py +64 -2
  118. oci/database_management/models/managed_database.py +2 -4
  119. oci/database_management/models/managed_database_summary.py +2 -4
  120. oci/database_management/models/modify_database_management_feature_details.py +1 -1
  121. oci/database_management/perfhub_client.py +1 -1
  122. oci/database_management/sql_tuning_client.py +17 -17
  123. oci/database_migration/database_migration_client.py +42 -42
  124. oci/database_tools/database_tools_client.py +23 -23
  125. oci/dblm/db_life_cycle_management_client.py +14 -14
  126. oci/delegate_access_control/delegate_access_control_client.py +26 -26
  127. oci/delegate_access_control/work_request_client.py +4 -4
  128. oci/demand_signal/occ_demand_signal_client.py +7 -7
  129. oci/desktops/desktop_service_client.py +21 -21
  130. oci/devops/devops_client.py +141 -141
  131. oci/disaster_recovery/disaster_recovery_client.py +31 -31
  132. oci/distributed_database/__init__.py +20 -0
  133. oci/distributed_database/distributed_autonomous_db_service_client.py +2315 -0
  134. oci/distributed_database/distributed_autonomous_db_service_client_composite_operations.py +605 -0
  135. oci/distributed_database/distributed_db_private_endpoint_service_client.py +944 -0
  136. oci/distributed_database/distributed_db_private_endpoint_service_client_composite_operations.py +238 -0
  137. oci/distributed_database/distributed_db_service_client.py +2435 -0
  138. oci/distributed_database/distributed_db_service_client_composite_operations.py +647 -0
  139. oci/distributed_database/distributed_db_work_request_service_client.py +654 -0
  140. oci/distributed_database/distributed_db_work_request_service_client_composite_operations.py +26 -0
  141. oci/distributed_database/models/__init__.py +158 -0
  142. oci/distributed_database/models/add_distributed_autonomous_database_gds_control_node_details.py +105 -0
  143. oci/distributed_database/models/add_distributed_database_gds_control_node_details.py +105 -0
  144. oci/distributed_database/models/catalog_peer_with_dedicated_infra.py +331 -0
  145. oci/distributed_database/models/catalog_peer_with_exadb_xs.py +331 -0
  146. oci/distributed_database/models/change_distributed_autonomous_database_compartment_details.py +74 -0
  147. oci/distributed_database/models/change_distributed_database_compartment_details.py +74 -0
  148. oci/distributed_database/models/change_distributed_database_private_endpoint_compartment_details.py +74 -0
  149. oci/distributed_database/models/change_distributed_db_backup_config_details.py +66 -0
  150. oci/distributed_database/models/configure_distributed_autonomous_database_gsms_details.py +103 -0
  151. oci/distributed_database/models/configure_distributed_database_gsms_details.py +103 -0
  152. oci/distributed_database/models/create_distributed_autonomous_database_catalog_details.py +101 -0
  153. oci/distributed_database/models/create_distributed_autonomous_database_catalog_with_dedicated_infra_details.py +342 -0
  154. oci/distributed_database/models/create_distributed_autonomous_database_details.py +799 -0
  155. oci/distributed_database/models/create_distributed_autonomous_database_shard_details.py +101 -0
  156. oci/distributed_database/models/create_distributed_autonomous_database_shard_with_dedicated_infra_details.py +377 -0
  157. oci/distributed_database/models/create_distributed_database_catalog_details.py +99 -0
  158. oci/distributed_database/models/create_distributed_database_catalog_with_exadb_xs_details.py +282 -0
  159. oci/distributed_database/models/create_distributed_database_details.py +810 -0
  160. oci/distributed_database/models/create_distributed_database_private_endpoint_details.py +260 -0
  161. oci/distributed_database/models/create_distributed_database_shard_details.py +99 -0
  162. oci/distributed_database/models/create_distributed_database_shard_with_exadb_xs_details.py +282 -0
  163. oci/distributed_database/models/distributed_autonomous_database.py +1143 -0
  164. oci/distributed_database/models/distributed_autonomous_database_associated_with_private_endpoint.py +105 -0
  165. oci/distributed_database/models/distributed_autonomous_database_catalog.py +194 -0
  166. oci/distributed_database/models/distributed_autonomous_database_catalog_with_dedicated_infra.py +559 -0
  167. oci/distributed_database/models/distributed_autonomous_database_collection.py +70 -0
  168. oci/distributed_database/models/distributed_autonomous_database_connection_string.py +70 -0
  169. oci/distributed_database/models/distributed_autonomous_database_gsm.py +385 -0
  170. oci/distributed_database/models/distributed_autonomous_database_gsm_image.py +105 -0
  171. oci/distributed_database/models/distributed_autonomous_database_shard.py +194 -0
  172. oci/distributed_database/models/distributed_autonomous_database_shard_with_dedicated_infra.py +592 -0
  173. oci/distributed_database/models/distributed_autonomous_database_summary.py +935 -0
  174. oci/distributed_database/models/distributed_autonomous_db_metadata.py +70 -0
  175. oci/distributed_database/models/distributed_database.py +1154 -0
  176. oci/distributed_database/models/distributed_database_associated_with_private_endpoint.py +105 -0
  177. oci/distributed_database/models/distributed_database_catalog.py +192 -0
  178. oci/distributed_database/models/distributed_database_catalog_with_exadb_xs.py +466 -0
  179. oci/distributed_database/models/distributed_database_collection.py +70 -0
  180. oci/distributed_database/models/distributed_database_gsm.py +385 -0
  181. oci/distributed_database/models/distributed_database_private_endpoint.py +639 -0
  182. oci/distributed_database/models/distributed_database_private_endpoint_collection.py +70 -0
  183. oci/distributed_database/models/distributed_database_private_endpoint_summary.py +479 -0
  184. oci/distributed_database/models/distributed_database_shard.py +192 -0
  185. oci/distributed_database/models/distributed_database_shard_with_exadb_xs.py +499 -0
  186. oci/distributed_database/models/distributed_database_summary.py +904 -0
  187. oci/distributed_database/models/distributed_db_backup_config.py +536 -0
  188. oci/distributed_database/models/distributed_db_backup_destination.py +362 -0
  189. oci/distributed_database/models/distributed_db_connection_string.py +70 -0
  190. oci/distributed_database/models/distributed_db_gsm_image.py +105 -0
  191. oci/distributed_database/models/distributed_db_metadata.py +70 -0
  192. oci/distributed_database/models/generate_distributed_autonomous_database_wallet_details.py +70 -0
  193. oci/distributed_database/models/generate_distributed_database_wallet_details.py +70 -0
  194. oci/distributed_database/models/patch_distributed_autonomous_database_details.py +73 -0
  195. oci/distributed_database/models/patch_distributed_database_details.py +73 -0
  196. oci/distributed_database/models/patch_insert_instruction.py +87 -0
  197. oci/distributed_database/models/patch_instruction.py +154 -0
  198. oci/distributed_database/models/patch_merge_instruction.py +95 -0
  199. oci/distributed_database/models/patch_remove_instruction.py +57 -0
  200. oci/distributed_database/models/shard_peer_with_dedicated_infra.py +331 -0
  201. oci/distributed_database/models/shard_peer_with_exadb_xs.py +331 -0
  202. oci/distributed_database/models/update_distributed_autonomous_database_details.py +136 -0
  203. oci/distributed_database/models/update_distributed_database_details.py +136 -0
  204. oci/distributed_database/models/update_distributed_database_private_endpoint_details.py +198 -0
  205. oci/distributed_database/models/upload_distributed_autonomous_database_signed_certificate_and_generate_wallet_details.py +71 -0
  206. oci/distributed_database/models/upload_distributed_database_signed_certificate_and_generate_wallet_details.py +71 -0
  207. oci/distributed_database/models/work_request.py +516 -0
  208. oci/distributed_database/models/work_request_error.py +134 -0
  209. oci/distributed_database/models/work_request_error_collection.py +70 -0
  210. oci/distributed_database/models/work_request_log_entry.py +101 -0
  211. oci/distributed_database/models/work_request_log_entry_collection.py +70 -0
  212. oci/distributed_database/models/work_request_resource.py +232 -0
  213. oci/distributed_database/models/work_request_summary.py +516 -0
  214. oci/distributed_database/models/work_request_summary_collection.py +70 -0
  215. oci/dns/dns_client.py +54 -54
  216. oci/dts/appliance_export_job_client.py +6 -6
  217. oci/dts/shipping_vendors_client.py +1 -1
  218. oci/dts/transfer_appliance_client.py +8 -8
  219. oci/dts/transfer_appliance_entitlement_client.py +3 -3
  220. oci/dts/transfer_device_client.py +5 -5
  221. oci/dts/transfer_job_client.py +6 -6
  222. oci/dts/transfer_package_client.py +7 -7
  223. oci/em_warehouse/em_warehouse_client.py +13 -13
  224. oci/email/email_client.py +31 -31
  225. oci/email_data_plane/email_dp_client.py +1 -1
  226. oci/events/events_client.py +6 -6
  227. oci/file_storage/file_storage_client.py +74 -74
  228. oci/fleet_apps_management/fleet_apps_management_admin_client.py +27 -27
  229. oci/fleet_apps_management/fleet_apps_management_catalog_client.py +7 -7
  230. oci/fleet_apps_management/fleet_apps_management_client.py +32 -32
  231. oci/fleet_apps_management/fleet_apps_management_maintenance_window_client.py +5 -5
  232. oci/fleet_apps_management/fleet_apps_management_operations_client.py +29 -29
  233. oci/fleet_apps_management/fleet_apps_management_provision_client.py +6 -6
  234. oci/fleet_apps_management/fleet_apps_management_runbooks_client.py +19 -19
  235. oci/fleet_apps_management/fleet_apps_management_work_request_client.py +4 -4
  236. oci/fleet_software_update/fleet_software_update_client.py +46 -46
  237. oci/functions/functions_invoke_client.py +1 -1
  238. oci/functions/functions_management_client.py +16 -16
  239. oci/fusion_apps/fusion_applications_client.py +41 -41
  240. oci/generative_ai/generative_ai_client.py +22 -22
  241. oci/generative_ai/models/create_dedicated_ai_cluster_details.py +4 -0
  242. oci/generative_ai/models/dedicated_ai_cluster.py +11 -3
  243. oci/generative_ai_agent/generative_ai_agent_client.py +38 -38
  244. oci/generative_ai_agent_runtime/generative_ai_agent_runtime_client.py +6 -6
  245. oci/generative_ai_inference/generative_ai_inference_client.py +6 -6
  246. oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
  247. oci/globally_distributed_database/sharded_database_service_client.py +58 -58
  248. oci/golden_gate/golden_gate_client.py +89 -89
  249. oci/governance_rules_control_plane/governance_rule_client.py +15 -15
  250. oci/governance_rules_control_plane/work_request_client.py +5 -5
  251. oci/healthchecks/health_checks_client.py +17 -17
  252. oci/identity/identity_client.py +145 -145
  253. oci/identity_data_plane/dataplane_client.py +2 -2
  254. oci/identity_domains/identity_domains_client.py +311 -311
  255. oci/integration/integration_instance_client.py +19 -19
  256. oci/jms/java_management_service_client.py +79 -79
  257. oci/jms_java_downloads/java_download_client.py +25 -25
  258. oci/key_management/ekm_client.py +5 -5
  259. oci/key_management/kms_crypto_client.py +6 -6
  260. oci/key_management/kms_hsm_cluster_client.py +12 -12
  261. oci/key_management/kms_management_client.py +21 -21
  262. oci/key_management/kms_vault_client.py +14 -14
  263. oci/license_manager/license_manager_client.py +18 -18
  264. oci/limits/limits_client.py +4 -4
  265. oci/limits/quotas_client.py +7 -7
  266. oci/load_balancer/load_balancer_client.py +61 -61
  267. oci/lockbox/lockbox_client.py +24 -24
  268. oci/log_analytics/log_analytics_client.py +200 -200
  269. oci/logging/logging_management_client.py +30 -30
  270. oci/loggingingestion/logging_client.py +1 -1
  271. oci/loggingsearch/log_search_client.py +1 -1
  272. oci/lustre_file_storage/lustre_file_storage_client.py +11 -11
  273. oci/management_agent/management_agent_client.py +28 -28
  274. oci/management_dashboard/dashx_apis_client.py +14 -14
  275. oci/marketplace/account_client.py +2 -2
  276. oci/marketplace/marketplace_client.py +30 -30
  277. oci/marketplace_private_offer/attachment_client.py +5 -5
  278. oci/marketplace_private_offer/offer_client.py +6 -6
  279. oci/marketplace_publisher/attachment_client.py +5 -5
  280. oci/marketplace_publisher/marketplace_publisher_client.py +71 -71
  281. oci/marketplace_publisher/offer_client.py +6 -6
  282. oci/media_services/media_services_client.py +60 -60
  283. oci/media_services/media_stream_client.py +2 -2
  284. oci/mngdmac/mac_device_client.py +3 -3
  285. oci/mngdmac/mac_order_client.py +11 -11
  286. oci/model_deployment/__init__.py +14 -0
  287. oci/model_deployment/model_deployment_client.py +331 -0
  288. oci/model_deployment/model_deployment_client_composite_operations.py +26 -0
  289. oci/model_deployment/models/__init__.py +14 -0
  290. oci/model_deployment/models/inference_result.py +70 -0
  291. oci/monitoring/monitoring_client.py +18 -18
  292. oci/mysql/channels_client.py +7 -7
  293. oci/mysql/db_backups_client.py +7 -7
  294. oci/mysql/db_system_client.py +17 -17
  295. oci/mysql/models/create_db_system_details.py +31 -0
  296. oci/mysql/models/db_system.py +31 -0
  297. oci/mysql/models/db_system_snapshot.py +31 -0
  298. oci/mysql/models/replica.py +31 -0
  299. oci/mysql/models/replica_overrides.py +33 -2
  300. oci/mysql/models/replica_summary.py +31 -0
  301. oci/mysql/models/update_db_system_details.py +31 -0
  302. oci/mysql/mysqlaas_client.py +7 -7
  303. oci/mysql/replicas_client.py +5 -5
  304. oci/mysql/work_requests_client.py +4 -4
  305. oci/network_firewall/network_firewall_client.py +86 -86
  306. oci/network_load_balancer/network_load_balancer_client.py +35 -35
  307. oci/nosql/nosql_client.py +24 -24
  308. oci/object_storage/object_storage_client.py +55 -55
  309. oci/oce/oce_instance_client.py +10 -10
  310. oci/oci_control_center/occ_metrics_client.py +3 -3
  311. oci/ocvp/cluster_client.py +5 -5
  312. oci/ocvp/esxi_host_client.py +8 -8
  313. oci/ocvp/sddc_client.py +14 -14
  314. oci/ocvp/work_request_client.py +4 -4
  315. oci/oda/management_client.py +59 -59
  316. oci/oda/oda_client.py +17 -17
  317. oci/oda/odapackage_client.py +7 -7
  318. oci/onesubscription/billing_schedule_client.py +1 -1
  319. oci/onesubscription/commitment_client.py +2 -2
  320. oci/onesubscription/computed_usage_client.py +3 -3
  321. oci/onesubscription/invoice_summary_client.py +2 -2
  322. oci/onesubscription/organization_subscription_client.py +1 -1
  323. oci/onesubscription/ratecard_client.py +1 -1
  324. oci/onesubscription/subscribed_service_client.py +2 -2
  325. oci/onesubscription/subscription_client.py +1 -1
  326. oci/ons/notification_control_plane_client.py +6 -6
  327. oci/ons/notification_data_plane_client.py +10 -10
  328. oci/opa/opa_instance_client.py +13 -13
  329. oci/opensearch/models/__init__.py +2 -0
  330. oci/opensearch/models/create_opensearch_cluster_details.py +291 -0
  331. oci/opensearch/models/create_opensearch_cluster_pipeline_details.py +31 -0
  332. oci/opensearch/models/opensearch_cluster.py +291 -0
  333. oci/opensearch/models/opensearch_cluster_pipeline.py +31 -0
  334. oci/opensearch/models/opensearch_cluster_pipeline_summary.py +31 -0
  335. oci/opensearch/models/resize_opensearch_cluster_horizontal_details.py +31 -0
  336. oci/opensearch/models/resize_opensearch_cluster_vertical_details.py +217 -0
  337. oci/opensearch/models/shapes_details.py +70 -0
  338. oci/opensearch/models/update_cluster_specs_details.py +186 -0
  339. oci/opensearch/models/update_opensearch_cluster_pipeline_details.py +31 -0
  340. oci/opensearch/opensearch_cluster_backup_client.py +4 -4
  341. oci/opensearch/opensearch_cluster_client.py +87 -16
  342. oci/opensearch/opensearch_cluster_pipeline_client.py +5 -5
  343. oci/operator_access_control/access_requests_client.py +10 -10
  344. oci/operator_access_control/operator_actions_client.py +2 -2
  345. oci/operator_access_control/operator_control_assignment_client.py +8 -8
  346. oci/operator_access_control/operator_control_client.py +6 -6
  347. oci/opsi/operations_insights_client.py +181 -181
  348. oci/optimizer/optimizer_client.py +26 -26
  349. oci/os_management/event_client.py +8 -8
  350. oci/os_management/os_management_client.py +69 -69
  351. oci/os_management_hub/event_client.py +8 -8
  352. oci/os_management_hub/lifecycle_environment_client.py +13 -13
  353. oci/os_management_hub/managed_instance_client.py +33 -33
  354. oci/os_management_hub/managed_instance_group_client.py +26 -26
  355. oci/os_management_hub/management_station_client.py +10 -10
  356. oci/os_management_hub/onboarding_client.py +13 -13
  357. oci/os_management_hub/reporting_managed_instance_client.py +3 -3
  358. oci/os_management_hub/scheduled_job_client.py +7 -7
  359. oci/os_management_hub/software_source_client.py +33 -33
  360. oci/os_management_hub/work_request_client.py +5 -5
  361. oci/osp_gateway/address_rule_service_client.py +1 -1
  362. oci/osp_gateway/address_service_client.py +2 -2
  363. oci/osp_gateway/invoice_service_client.py +5 -5
  364. oci/osp_gateway/subscription_service_client.py +5 -5
  365. oci/osub_billing_schedule/billing_schedule_client.py +1 -1
  366. oci/osub_organization_subscription/organization_subscription_client.py +1 -1
  367. oci/osub_subscription/commitment_client.py +2 -2
  368. oci/osub_subscription/ratecard_client.py +1 -1
  369. oci/osub_subscription/subscription_client.py +1 -1
  370. oci/osub_usage/computed_usage_client.py +3 -3
  371. oci/psql/postgresql_client.py +34 -34
  372. oci/queue/queue_admin_client.py +11 -11
  373. oci/queue/queue_client.py +8 -8
  374. oci/recovery/database_recovery_client.py +26 -26
  375. oci/redis/redis_cluster_client.py +12 -12
  376. oci/resource_manager/resource_manager_client.py +52 -52
  377. oci/resource_scheduler/schedule_client.py +14 -14
  378. oci/resource_search/resource_search_client.py +3 -3
  379. oci/rover/rover_bundle_client.py +8 -8
  380. oci/rover/rover_cluster_client.py +8 -8
  381. oci/rover/rover_entitlement_client.py +6 -6
  382. oci/rover/rover_node_client.py +15 -15
  383. oci/rover/shape_client.py +1 -1
  384. oci/rover/work_requests_client.py +5 -5
  385. oci/sch/connector_plugins_client.py +2 -2
  386. oci/sch/service_connector_client.py +12 -12
  387. oci/secrets/secrets_client.py +3 -3
  388. oci/security_attribute/security_attribute_client.py +18 -18
  389. oci/service_catalog/service_catalog_client.py +26 -26
  390. oci/service_manager_proxy/service_manager_proxy_client.py +2 -2
  391. oci/service_mesh/service_mesh_client.py +48 -48
  392. oci/stack_monitoring/stack_monitoring_client.py +87 -87
  393. oci/streaming/stream_admin_client.py +18 -18
  394. oci/streaming/stream_client.py +8 -8
  395. oci/tenant_manager_control_plane/domain_client.py +5 -5
  396. oci/tenant_manager_control_plane/domain_governance_client.py +5 -5
  397. oci/tenant_manager_control_plane/governance_client.py +2 -2
  398. oci/tenant_manager_control_plane/link_client.py +3 -3
  399. oci/tenant_manager_control_plane/orders_client.py +2 -2
  400. oci/tenant_manager_control_plane/organization_client.py +10 -10
  401. oci/tenant_manager_control_plane/recipient_invitation_client.py +5 -5
  402. oci/tenant_manager_control_plane/sender_invitation_client.py +5 -5
  403. oci/tenant_manager_control_plane/subscription_client.py +11 -11
  404. oci/tenant_manager_control_plane/work_request_client.py +4 -4
  405. oci/threat_intelligence/threatintel_client.py +5 -5
  406. oci/usage/resources_client.py +2 -2
  407. oci/usage/rewards_client.py +6 -6
  408. oci/usage/usagelimits_client.py +1 -1
  409. oci/usage_api/usageapi_client.py +33 -33
  410. oci/vault/vaults_client.py +13 -13
  411. oci/vbs_inst/vbs_instance_client.py +10 -10
  412. oci/version.py +1 -1
  413. oci/visual_builder/vb_instance_client.py +14 -14
  414. oci/vn_monitoring/vn_monitoring_client.py +12 -12
  415. oci/vulnerability_scanning/vulnerability_scanning_client.py +58 -58
  416. oci/waa/waa_client.py +13 -13
  417. oci/waa/work_request_client.py +4 -4
  418. oci/waas/redirect_client.py +6 -6
  419. oci/waas/waas_client.py +66 -66
  420. oci/waf/waf_client.py +24 -24
  421. oci/work_requests/work_request_client.py +4 -4
  422. oci/zpr/zpr_client.py +15 -15
  423. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/METADATA +6 -1
  424. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/RECORD +428 -313
  425. oci/database_management/models/disable_external_mysql_associated_service_details.py +0 -144
  426. oci/database_management/models/enable_external_mysql_associated_service_details.py +0 -144
  427. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/LICENSE.txt +0 -0
  428. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  429. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/WHEEL +0 -0
  430. {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,682 @@
1
+ # coding: utf-8
2
+ # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
3
+ # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
+
5
+ """
6
+ ADK Agent Client
7
+ """
8
+
9
+ from typing import Any, Callable, Dict, List, Literal, Optional, Tuple
10
+
11
+ import oci
12
+ from oci.constants import HEADER_REQUEST_ID
13
+ from oci.exceptions import ClientError, ServiceError
14
+ from oci.generative_ai_agent import GenerativeAiAgentClient
15
+ from oci.generative_ai_agent.models import (
16
+ CreateToolDetails,
17
+ Function,
18
+ FunctionCallingToolConfig,
19
+ KnowledgeBaseConfig,
20
+ LlmConfig,
21
+ LlmCustomization,
22
+ RagToolConfig,
23
+ UpdateAgentDetails,
24
+ UpdateToolDetails,
25
+ )
26
+ from oci.generative_ai_agent_runtime import GenerativeAiAgentRuntimeClient
27
+ from oci.generative_ai_agent_runtime.models import (
28
+ ChatDetails,
29
+ ChatResult,
30
+ CreateSessionDetails,
31
+ FunctionCallingPerformedAction,
32
+ Session,
33
+ )
34
+ from oci.response import Response
35
+ from oci.util import formatted_flat_dict, to_dict
36
+ from oci.pagination import list_call_get_all_results
37
+
38
+ from oci.addons.adk.agent_error import AgentError, UserError
39
+ from oci.addons.adk.auth.factory import AuthFactory, OCIAuthType
40
+ from oci.addons.adk.constants import (
41
+ DEFAULT_SESSION_NAME,
42
+ DEFAULT_TIMEOUT,
43
+ DESC_SUFFIX,
44
+ FREEFORM_TAGS,
45
+ )
46
+ from oci.addons.adk.logger import default_logger as logger
47
+ from oci.addons.adk.run.types import PerformedAction
48
+ from oci.addons.adk.tool import FunctionTool
49
+ from oci.addons.adk.tool.prebuilt import AgenticRagTool
50
+ from oci.addons.adk.util import build_custom_function_params, get_region_endpoint
51
+
52
+
53
+ class AgentClient:
54
+ """Client for interacting with OCI Agent endpoints."""
55
+
56
+ def __init__(
57
+ self,
58
+ auth_type: Optional[str] = "api_key",
59
+ config: Optional[str] = oci.config.DEFAULT_LOCATION,
60
+ profile: Optional[str] = oci.config.DEFAULT_PROFILE,
61
+ token: Optional[str] = None,
62
+ region: Optional[str] = None,
63
+ runtime_endpoint: Optional[str] = None,
64
+ management_endpoint: Optional[str] = None,
65
+ timeout: Optional[float | Tuple[float, float]] = DEFAULT_TIMEOUT,
66
+ debug: Optional[bool] = False,
67
+ ) -> None:
68
+ """
69
+ Initialize the agent client.
70
+
71
+ Args:
72
+ auth_type: The authentication type, Must be
73
+ one of: 'api_key', 'security_token', 'instance_principal',
74
+ 'resource_principal', 'instance_obo_user'
75
+ config: The config file path for the agent client
76
+ profile: The profile to use for authentication
77
+ token: The token to use for authentication
78
+ region: The region to use for authentication
79
+ If provided, runtime_endpoint and management_endpoint will be
80
+ constructed automatically unless explicitly specified
81
+ runtime_endpoint: The runtime endpoint for OCI Generative AI Agent
82
+ management_endpoint: The management endpoint for OCI Generative AI Agent
83
+ timeout: The timeout for the agent client
84
+ debug: Whether to enable debug logging
85
+
86
+ Raises:
87
+ AgentError: If the agent endpoint id is unknown
88
+ """
89
+ # use auth module
90
+ self.auth = AuthFactory.create_oci_auth(
91
+ auth_type=OCIAuthType(auth_type),
92
+ config_path=config,
93
+ profile=profile,
94
+ token=token,
95
+ region=region,
96
+ )
97
+
98
+ # endpoint
99
+ self.runtime_endpoint = self.get_runtime_endpoint(runtime_endpoint, region)
100
+ self.management_endpoint = self.get_management_endpoint(
101
+ management_endpoint, region
102
+ )
103
+
104
+ # init Agent Runtime Client
105
+ self._rt_client = GenerativeAiAgentRuntimeClient(
106
+ config=self.auth.get_config(),
107
+ signer=self.auth.get_auth_credentials(),
108
+ service_endpoint=self.runtime_endpoint,
109
+ timeout=timeout,
110
+ retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY,
111
+ )
112
+ # init Agent client
113
+ self._mgmt_client = GenerativeAiAgentClient(
114
+ config=self.auth.get_config(),
115
+ signer=self.auth.get_auth_credentials(),
116
+ service_endpoint=self.management_endpoint,
117
+ timeout=timeout,
118
+ retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY,
119
+ )
120
+ self.debug = debug
121
+ self._handlers: Dict[str, Callable] = {}
122
+
123
+ def create_session(
124
+ self,
125
+ agent_endpoint_id: str,
126
+ display_name: str | None = None,
127
+ description: str | None = None,
128
+ ) -> str:
129
+ """
130
+ Create a new agent session.
131
+
132
+ Args:
133
+ agent_endpoint_id: The agent endpoint id
134
+ display_name: Name for the session
135
+ description: Description for the session
136
+
137
+ Returns:
138
+ The session ID
139
+
140
+ Raises:
141
+ AgentError: If session creation fails
142
+ """
143
+ create_session_details = CreateSessionDetails()
144
+ create_session_details.display_name = (
145
+ display_name if display_name else DEFAULT_SESSION_NAME
146
+ )
147
+ create_session_details.description = (
148
+ description if description else DEFAULT_SESSION_NAME + DESC_SUFFIX
149
+ )
150
+
151
+ logger.debug(f"Creating session with details: {create_session_details}")
152
+
153
+ create_session_response: Response = self._invoke(
154
+ method=self._rt_client.create_session,
155
+ success_message="Session creation succeeded",
156
+ error_message="Failed to create session",
157
+ debug=self.debug,
158
+ create_session_details=create_session_details,
159
+ agent_endpoint_id=agent_endpoint_id,
160
+ )
161
+ response_data: Session = create_session_response.data
162
+ return response_data.id
163
+
164
+ def delete_session(self, agent_endpoint_id: str, session_id: str) -> None:
165
+ """
166
+ Delete an existing agent session.
167
+
168
+ Args:
169
+ agent_endpoint_id: The agent endpoint id
170
+ session_id: The session ID to delete
171
+
172
+ Returns:
173
+ None
174
+
175
+ Raises:
176
+ AgentError: If session deletion fails
177
+ """
178
+ logger.debug(f"Deleting session: {session_id}")
179
+ self._invoke(
180
+ method=self._rt_client.delete_session,
181
+ success_message="Session deletion succeeded",
182
+ error_message="Failed to delete session",
183
+ debug=self.debug,
184
+ session_id=session_id,
185
+ agent_endpoint_id=agent_endpoint_id,
186
+ )
187
+ return
188
+
189
+ def chat(
190
+ self,
191
+ agent_endpoint_id: str,
192
+ session_id: str,
193
+ user_message: Optional[str] = None,
194
+ performed_actions: Optional[List[PerformedAction]] = None,
195
+ ) -> Dict[str, Any]:
196
+ """
197
+ Invoke a chat session with the agent.
198
+
199
+ Args:
200
+ agent_endpoint_id: The agent endpoint id
201
+ session_id: The session ID to use for the chat
202
+ user_message: The message from the user
203
+ performed_actions: Actions that have been performed
204
+
205
+ Returns:
206
+ The response from the agent
207
+
208
+ Raises:
209
+ AgentError: If the invocation fails
210
+ """
211
+ chat_details = ChatDetails()
212
+ fc_performed_actions = []
213
+ if performed_actions:
214
+ fc_performed_actions = [
215
+ FunctionCallingPerformedAction(
216
+ action_id=action.action_id,
217
+ performed_action_type=action.performed_action_type,
218
+ function_call_output=action.function_call_output,
219
+ )
220
+ for action in performed_actions
221
+ ]
222
+ chat_details.performed_actions = fc_performed_actions
223
+ chat_details.user_message = user_message
224
+ chat_details.should_stream = False
225
+ chat_details.session_id = session_id
226
+
227
+ logger.debug(f"Invoking chat endpoint with data: {chat_details}")
228
+
229
+ chat_response: Response = self._invoke(
230
+ method=self._rt_client.chat,
231
+ success_message="Chat succeeded",
232
+ error_message="Failed to invoke chat endpoint",
233
+ debug=self.debug,
234
+ chat_details=chat_details,
235
+ agent_endpoint_id=agent_endpoint_id,
236
+ )
237
+
238
+ response_data: ChatResult = chat_response.data
239
+ return to_dict(response_data)
240
+
241
+ def update_agent(
242
+ self,
243
+ agent_id: str,
244
+ name: str | None = None,
245
+ description: str | None = None,
246
+ instructions: str | None = None,
247
+ ) -> None:
248
+ """
249
+ Update the agent.
250
+
251
+ Args:
252
+ agent_id: The ID of the agent to update
253
+ name: The new name for the agent
254
+ description: The new description for the agent
255
+ instructions: The new instructions for the agent
256
+
257
+ Returns:
258
+ None
259
+
260
+ Raises:
261
+ AgentError: If updating the instructions fails
262
+ """
263
+ update_agent_details = UpdateAgentDetails(freeform_tags=FREEFORM_TAGS)
264
+ if name is not None:
265
+ update_agent_details.display_name = name
266
+ if description is not None:
267
+ update_agent_details.description = description
268
+ if instructions is not None:
269
+ llm_customization = LlmCustomization(
270
+ instruction=instructions,
271
+ )
272
+ update_agent_details.llm_config = LlmConfig(
273
+ routing_llm_customization=llm_customization,
274
+ )
275
+ self._invoke(
276
+ method=self._mgmt_client.update_agent,
277
+ success_message="Agent updated successfully",
278
+ error_message="Failed to update agent",
279
+ debug=self.debug,
280
+ update_agent_details=update_agent_details,
281
+ agent_id=agent_id,
282
+ )
283
+
284
+ def find_tools(self, compartment_id: str, agent_id: str) -> List[Dict[str, Any]]:
285
+ """
286
+ Find tools associated with the agent.
287
+
288
+ Args:
289
+ compartment_id: The compartment ID
290
+ agent_id: The agent ID
291
+
292
+ Returns:
293
+ List of tools
294
+
295
+ Raises:
296
+ AgentError: If finding tools fails
297
+ """
298
+ # use pagination to eagerly get all records
299
+ find_tools_response: Response = self._invoke(
300
+ method=list_call_get_all_results,
301
+ success_message="Tools retrieval succeeded",
302
+ error_message="Failed to find tools",
303
+ debug=self.debug,
304
+ list_func_ref=self._mgmt_client.list_tools,
305
+ compartment_id=compartment_id,
306
+ agent_id=agent_id,
307
+ )
308
+
309
+ return [to_dict(tool) for tool in find_tools_response.data]
310
+
311
+ def delete_tool(self, tool_id: str) -> None:
312
+ """
313
+ Delete a tool by ID.
314
+
315
+ Args:
316
+ tool_id: The ID of the tool to delete
317
+
318
+ Returns:
319
+ None
320
+
321
+ Raises:
322
+ AgentError: If tool deletion fails
323
+ """
324
+ self._invoke(
325
+ method=self._mgmt_client.delete_tool,
326
+ success_message="Tool deletion succeeded",
327
+ error_message="Failed to delete tool",
328
+ debug=self.debug,
329
+ tool_id=tool_id,
330
+ )
331
+
332
+ def add_function_tool(
333
+ self,
334
+ function: FunctionTool,
335
+ compartment_id: str,
336
+ agent_id: str,
337
+ ) -> Dict[str, Any]:
338
+ """
339
+ Add a function tool to the agent.
340
+
341
+ Args:
342
+ function: The function tool to add
343
+
344
+ Returns:
345
+ Dict[str, Any]: The added tool as a dict with its attributes
346
+
347
+ Raises:
348
+ AgentError: If adding the tool fails
349
+ """
350
+ tool_config = FunctionCallingToolConfig(
351
+ function=Function(
352
+ name=function.name,
353
+ description=function.description,
354
+ parameters=build_custom_function_params(function.parameters),
355
+ )
356
+ )
357
+ create_tool_details = CreateToolDetails(
358
+ display_name=function.name,
359
+ description=function.description,
360
+ compartment_id=compartment_id,
361
+ agent_id=agent_id,
362
+ tool_config=tool_config,
363
+ freeform_tags=FREEFORM_TAGS,
364
+ )
365
+
366
+ add_tool_response: Response = self._invoke(
367
+ method=self._mgmt_client.create_tool,
368
+ success_message="Tool addition succeeded",
369
+ error_message="Failed to add tool",
370
+ debug=self.debug,
371
+ create_tool_details=create_tool_details,
372
+ )
373
+
374
+ return to_dict(add_tool_response.data)
375
+
376
+ def get_tool(self, tool_id: str) -> Dict[str, Any]:
377
+ """
378
+ Get a tool by ID.
379
+
380
+ Args:
381
+ tool_id: The ID of the tool to get
382
+
383
+ Returns:
384
+ Dict[str, Any]: The tool as a dict with its attributes
385
+
386
+ Raises:
387
+ AgentError: If getting the tool fails
388
+ """
389
+ get_tool_response: Response = self._invoke(
390
+ method=self._mgmt_client.get_tool,
391
+ success_message="Tool retrieval succeeded",
392
+ error_message="Failed to get tool",
393
+ debug=self.debug,
394
+ tool_id=tool_id,
395
+ )
396
+
397
+ return to_dict(get_tool_response.data)
398
+
399
+ def add_rag_tool(
400
+ self,
401
+ rag_tool: AgenticRagTool,
402
+ compartment_id: str,
403
+ agent_id: str,
404
+ ) -> Dict[str, Any]:
405
+ """
406
+ Add an agentic RAG tool to the agent.
407
+
408
+ Args:
409
+ rag_tool: The RAG tool to add
410
+ compartment_id: The compartment ID
411
+ agent_id: The agent ID
412
+
413
+ Returns:
414
+ Dict[str, Any]: The added tool as a dict with its attributes
415
+
416
+ Raises:
417
+ AgentError: If adding the tool fails
418
+ """
419
+ tool_config = RagToolConfig(
420
+ knowledge_base_configs=[
421
+ KnowledgeBaseConfig(knowledge_base_id=kb_id)
422
+ for kb_id in rag_tool.knowledge_base_ids
423
+ ]
424
+ )
425
+ create_tool_details = CreateToolDetails(
426
+ compartment_id=compartment_id,
427
+ agent_id=agent_id,
428
+ display_name=rag_tool.name,
429
+ description=rag_tool.description,
430
+ tool_config=tool_config,
431
+ freeform_tags=FREEFORM_TAGS,
432
+ )
433
+
434
+ add_tool_response: Response = self._invoke(
435
+ method=self._mgmt_client.create_tool,
436
+ success_message="RAG tool addition succeeded",
437
+ error_message="""
438
+ Failed to add RAG tool
439
+ probably because a remote RAG tool not configured by ADK already exists
440
+ """,
441
+ debug=self.debug,
442
+ create_tool_details=create_tool_details,
443
+ )
444
+
445
+ return to_dict(add_tool_response.data)
446
+
447
+ def update_function_tool(
448
+ self,
449
+ tool_id: str,
450
+ function: FunctionTool,
451
+ ) -> None:
452
+ """
453
+ Update a function tool by ID.
454
+
455
+ Args:
456
+ tool_id: The ID of the tool to update
457
+ function: The function tool to update
458
+
459
+ Returns:
460
+ None
461
+
462
+ Raises:
463
+ AgentError: If updating the tool fails
464
+ """
465
+ tool_config = FunctionCallingToolConfig(
466
+ function=Function(
467
+ name=function.name,
468
+ description=function.description,
469
+ parameters=build_custom_function_params(function.parameters),
470
+ )
471
+ )
472
+ update_tool_details = UpdateToolDetails(
473
+ display_name=function.name,
474
+ description=function.description,
475
+ tool_config=tool_config,
476
+ freeform_tags=FREEFORM_TAGS,
477
+ )
478
+
479
+ self._invoke(
480
+ method=self._mgmt_client.update_tool,
481
+ success_message="Tool update succeeded",
482
+ error_message="Failed to update tool",
483
+ debug=self.debug,
484
+ tool_id=tool_id,
485
+ update_tool_details=update_tool_details,
486
+ )
487
+
488
+ def update_rag_tool(
489
+ self,
490
+ tool_id: str,
491
+ rag_tool: AgenticRagTool,
492
+ ) -> None:
493
+ """
494
+ Update a rag tool by ID.
495
+
496
+ Args:
497
+ tool_id: The ID of the tool to update
498
+ rag_tool: The rag tool to update
499
+
500
+ Returns:
501
+ None
502
+
503
+ Raises:
504
+ AgentError: If updating the tool fails
505
+ """
506
+ tool_config = RagToolConfig(
507
+ knowledge_base_configs=[
508
+ KnowledgeBaseConfig(knowledge_base_id=kb_id)
509
+ for kb_id in rag_tool.knowledge_base_ids
510
+ ]
511
+ )
512
+ update_tool_details = UpdateToolDetails(
513
+ display_name=rag_tool.name,
514
+ description=rag_tool.description,
515
+ tool_config=tool_config,
516
+ freeform_tags=FREEFORM_TAGS,
517
+ )
518
+
519
+ self._invoke(
520
+ method=self._mgmt_client.update_tool,
521
+ success_message="RAG tool update succeeded",
522
+ error_message="Failed to update RAG tool",
523
+ debug=self.debug,
524
+ tool_id=tool_id,
525
+ update_tool_details=update_tool_details,
526
+ )
527
+
528
+ def get_agent(self, agent_id: str) -> Dict[str, Any]:
529
+ """
530
+ Get the agent details.
531
+
532
+ Args:
533
+ agent_id: The ID of the agent
534
+
535
+ Returns:
536
+ The agent details
537
+
538
+ Raises:
539
+ AgentError: If getting the agent fails
540
+ """
541
+
542
+ get_agent_response: Response = self._invoke(
543
+ method=self._mgmt_client.get_agent,
544
+ success_message="Agent retrieval succeeded",
545
+ error_message="Failed to get agent",
546
+ debug=self.debug,
547
+ agent_id=agent_id,
548
+ )
549
+
550
+ return to_dict(get_agent_response.data)
551
+
552
+ def get_agent_endpoint_details(self, agent_endpoint_id: str) -> Dict[str, Any]:
553
+ """
554
+ Get the agent endpoint details.
555
+
556
+ Args:
557
+ agent_endpoint_id: The agent endpoint id
558
+
559
+ Returns:
560
+ The agent endpoint details
561
+
562
+ Raises:
563
+ AgentError: If getting the agent endpoint fails
564
+ """
565
+ get_agent_endpoint_response: Response = self._invoke(
566
+ method=self._mgmt_client.get_agent_endpoint,
567
+ success_message="Agent endpoint retrieval succeeded",
568
+ error_message="Failed to get agent endpoint",
569
+ debug=self.debug,
570
+ agent_endpoint_id=agent_endpoint_id,
571
+ )
572
+
573
+ return to_dict(get_agent_endpoint_response.data)
574
+
575
+ def get_runtime_endpoint(
576
+ self, endpoint_url: Optional[str], region: Optional[str]
577
+ ) -> str:
578
+ """
579
+ Get the runtime endpoint.
580
+
581
+ Args:
582
+ endpoint_url: The runtime endpoint
583
+ region: The region
584
+
585
+ Returns:
586
+ The runtime endpoint
587
+ """
588
+ return self._get_service_endpoint(endpoint_url, region, "agent-runtime")
589
+
590
+ def get_management_endpoint(
591
+ self, endpoint_url: Optional[str], region: Optional[str]
592
+ ) -> str:
593
+ """
594
+ Get the management endpoint.
595
+
596
+ Args:
597
+ endpoint_url: The management endpoint
598
+ region: The region
599
+
600
+ Returns:
601
+ The management endpoint
602
+ """
603
+ return self._get_service_endpoint(endpoint_url, region, "agent")
604
+
605
+ def _get_service_endpoint(
606
+ self,
607
+ endpoint_url: Optional[str] = None,
608
+ region: Optional[str] = None,
609
+ endpoint_type: Literal["agent-runtime", "agent"] = "agent-runtime",
610
+ ) -> str:
611
+ """
612
+ Set the service endpoint.
613
+
614
+ Args:
615
+ endpoint_url: The service endpoint
616
+ region: The region
617
+ endpoint_type: The endpoint type
618
+
619
+ Returns:
620
+ The service endpoint
621
+ """
622
+ # use endpoint if provided, otherwise use region
623
+ if endpoint_url:
624
+ return endpoint_url
625
+ elif region:
626
+ return get_region_endpoint(region, endpoint_type)
627
+ else:
628
+ raise UserError(
629
+ message="At least one of endpoint_url or region must be provided"
630
+ )
631
+
632
+ def _invoke(
633
+ self,
634
+ method: Callable,
635
+ success_message: str,
636
+ error_message: str,
637
+ debug: Optional[bool],
638
+ **kwargs,
639
+ ) -> Response:
640
+ """
641
+ Invoke a method.
642
+
643
+ Args:
644
+ method: The method to invoke
645
+ success_message: The success message for debug purposes
646
+ error_message: The error message
647
+ debug: Whether to enable debug logging
648
+ **kwargs: Additional keyword arguments to pass in method
649
+
650
+ Returns:
651
+ The response
652
+ """
653
+ response: Response | None = None
654
+ try:
655
+ response = method(**kwargs)
656
+ if response is None:
657
+ raise UserError(
658
+ message=error_message,
659
+ response=response,
660
+ )
661
+
662
+ if response.status not in (200, 202):
663
+ raise AgentError(message=error_message, response=response)
664
+
665
+ logger.debug(
666
+ f"{success_message} response: {formatted_flat_dict(response.data)}"
667
+ )
668
+ logger.debug(f"{success_message} {HEADER_REQUEST_ID}: {response.request_id}")
669
+
670
+ return response
671
+
672
+ except ServiceError as e:
673
+ raise AgentError(
674
+ message=f"{error_message}: {str(e)}",
675
+ response=response,
676
+ ) from e
677
+
678
+ except (ValueError, ClientError) as e:
679
+ raise UserError(
680
+ message=f"{error_message}: {str(e)}",
681
+ response=response,
682
+ ) from e
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
3
+ # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
+
5
+ from oci.response import Response
6
+
7
+
8
+ class AgentException(Exception):
9
+ """Base exception class for OCI Generative AI ADK errors"""
10
+
11
+ def __init__(self, message: str = "", response: Response | None = None):
12
+ self.message = message
13
+ self.response = response
14
+
15
+ if response is not None:
16
+ self.status_code = response.status
17
+ self.data = response.data
18
+ self.headers = response.headers
19
+ else:
20
+ self.status_code = None
21
+ self.data = None
22
+ self.headers = None
23
+
24
+ def __str__(self):
25
+ if self.response is not None:
26
+ return f"{self.message}. Status code: {self.status_code}. Response data: {self.data}. Response headers: {self.headers}" # noqa: E501
27
+ else:
28
+ return f"{self.message}"
29
+
30
+
31
+ class AgentError(AgentException):
32
+ """Exception for OCI Agent service errors"""
33
+
34
+
35
+ class UserError(AgentException):
36
+ """Exception for user errors"""