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.
- oci/__init__.py +2 -2
- oci/access_governance_cp/access_governance_cp_client.py +8 -8
- oci/addons/__init__.py +20 -0
- oci/addons/adk/__init__.py +13 -0
- oci/addons/adk/agent.py +852 -0
- oci/addons/adk/agent_client.py +682 -0
- oci/addons/adk/agent_error.py +36 -0
- oci/addons/adk/auth/__init__.py +5 -0
- oci/addons/adk/auth/auth_provider.py +28 -0
- oci/addons/adk/auth/factory.py +78 -0
- oci/addons/adk/auth/oci/__init__.py +5 -0
- oci/addons/adk/auth/oci/instance_principal.py +53 -0
- oci/addons/adk/auth/oci/resource_principal.py +53 -0
- oci/addons/adk/auth/oci/session.py +91 -0
- oci/addons/adk/auth/oci/user_principal.py +64 -0
- oci/addons/adk/constants.py +17 -0
- oci/addons/adk/logger.py +163 -0
- oci/addons/adk/run/__init__.py +5 -0
- oci/addons/adk/run/response.py +56 -0
- oci/addons/adk/run/types.py +32 -0
- oci/addons/adk/tool/__init__.py +13 -0
- oci/addons/adk/tool/function_tool.py +334 -0
- oci/addons/adk/tool/prebuilt/__init__.py +8 -0
- oci/addons/adk/tool/prebuilt/agentic_rag_tool.py +49 -0
- oci/addons/adk/tool/prebuilt/calculator_toolkit.py +104 -0
- oci/addons/adk/tool/tool.py +37 -0
- oci/addons/adk/tool/toolkit.py +189 -0
- oci/addons/adk/tool/utils.py +120 -0
- oci/addons/adk/util.py +325 -0
- oci/adm/application_dependency_management_client.py +36 -36
- oci/ai_anomaly_detection/anomaly_detection_client.py +36 -36
- oci/ai_document/ai_service_document_client.py +26 -26
- oci/ai_language/ai_service_language_client.py +44 -44
- oci/ai_speech/ai_service_speech_client.py +19 -19
- oci/ai_vision/ai_service_vision_client.py +28 -28
- oci/analytics/analytics_client.py +24 -24
- oci/announcements_service/announcement_client.py +5 -5
- oci/announcements_service/announcement_subscription_client.py +9 -9
- oci/announcements_service/announcements_preferences_client.py +4 -4
- oci/announcements_service/service_client.py +1 -1
- oci/apigateway/api_gateway_client.py +21 -21
- oci/apigateway/deployment_client.py +6 -6
- oci/apigateway/gateway_client.py +6 -6
- oci/apigateway/subscribers_client.py +6 -6
- oci/apigateway/usage_plans_client.py +6 -6
- oci/apigateway/work_requests_client.py +5 -5
- oci/apm_config/config_client.py +12 -12
- oci/apm_control_plane/apm_domain_client.py +14 -14
- oci/apm_synthetics/apm_synthetic_client.py +28 -28
- oci/apm_traces/attributes_client.py +8 -8
- oci/apm_traces/query_client.py +2 -2
- oci/apm_traces/trace_client.py +4 -4
- oci/appmgmt_control/appmgmt_control_client.py +8 -8
- oci/artifacts/artifacts_client.py +32 -32
- oci/audit/audit_client.py +3 -3
- oci/autoscaling/auto_scaling_client.py +11 -11
- oci/bastion/bastion_client.py +15 -15
- oci/bds/bds_client.py +84 -84
- oci/blockchain/blockchain_platform_client.py +27 -27
- oci/budget/budget_client.py +10 -10
- oci/capacity_management/capacity_management_client.py +32 -32
- oci/certificates/certificates_client.py +5 -5
- oci/certificates_management/certificates_management_client.py +32 -32
- oci/cims/incident_client.py +6 -6
- oci/cloud_bridge/common_client.py +5 -5
- oci/cloud_bridge/discovery_client.py +15 -15
- oci/cloud_bridge/inventory_client.py +16 -16
- oci/cloud_bridge/ocb_agent_svc_client.py +23 -23
- oci/cloud_guard/cloud_guard_client.py +155 -155
- oci/cloud_migrations/migration_client.py +43 -43
- oci/cluster_placement_groups/cluster_placement_groups_cp_client.py +13 -13
- oci/compute_cloud_at_customer/compute_cloud_at_customer_client.py +12 -12
- oci/compute_instance_agent/compute_instance_agent_client.py +6 -6
- oci/compute_instance_agent/plugin_client.py +2 -2
- oci/compute_instance_agent/pluginconfig_client.py +1 -1
- oci/container_engine/container_engine_client.py +46 -46
- oci/container_instances/container_instance_client.py +18 -18
- oci/core/blockstorage_client.py +60 -60
- oci/core/compute_client.py +117 -117
- oci/core/compute_management_client.py +32 -32
- oci/core/virtual_network_client.py +258 -258
- oci/dashboard_service/dashboard_client.py +6 -6
- oci/dashboard_service/dashboard_group_client.py +6 -6
- oci/data_catalog/data_catalog_client.py +149 -149
- oci/data_flow/data_flow_client.py +45 -45
- oci/data_integration/data_integration_client.py +163 -163
- oci/data_labeling_service/data_labeling_management_client.py +17 -17
- oci/data_labeling_service_dataplane/data_labeling_client.py +15 -15
- oci/data_safe/data_safe_client.py +317 -317
- oci/data_science/data_science_client.py +145 -145
- oci/database/database_client.py +745 -469
- oci/database/models/__init__.py +2 -0
- oci/database/models/autonomous_db_version_summary.py +31 -0
- oci/database/models/backup.py +4 -2
- oci/database/models/backup_summary.py +4 -2
- oci/database/models/create_external_backup_job_details.py +4 -4
- oci/database/models/db_system.py +4 -2
- oci/database/models/db_system_summary.py +4 -2
- oci/database/models/db_system_upgrade_summary.py +152 -0
- oci/database/models/external_container_database.py +4 -2
- oci/database/models/external_container_database_summary.py +4 -2
- oci/database/models/external_database_base.py +4 -2
- oci/database/models/external_non_container_database.py +4 -2
- oci/database/models/external_non_container_database_summary.py +4 -2
- oci/database/models/external_pluggable_database.py +4 -2
- oci/database/models/external_pluggable_database_summary.py +4 -2
- oci/database_management/db_management_client.py +356 -230
- oci/database_management/db_management_client_composite_operations.py +44 -0
- oci/database_management/diagnosability_client.py +4 -4
- oci/database_management/managed_my_sql_databases_client.py +7 -247
- oci/database_management/models/__init__.py +0 -4
- oci/database_management/models/database_diagnostics_and_management_feature_details.py +35 -4
- oci/database_management/models/disable_database_management_feature_details.py +33 -2
- oci/database_management/models/disable_external_container_database_management_feature_details.py +33 -2
- oci/database_management/models/discovered_external_database.py +64 -2
- oci/database_management/models/exadata_infrastructure_lifecycle_state_values.py +40 -36
- oci/database_management/models/external_database_diagnostics_and_management_feature_details.py +64 -2
- oci/database_management/models/managed_database.py +2 -4
- oci/database_management/models/managed_database_summary.py +2 -4
- oci/database_management/models/modify_database_management_feature_details.py +1 -1
- oci/database_management/perfhub_client.py +1 -1
- oci/database_management/sql_tuning_client.py +17 -17
- oci/database_migration/database_migration_client.py +42 -42
- oci/database_tools/database_tools_client.py +23 -23
- oci/dblm/db_life_cycle_management_client.py +14 -14
- oci/delegate_access_control/delegate_access_control_client.py +26 -26
- oci/delegate_access_control/work_request_client.py +4 -4
- oci/demand_signal/occ_demand_signal_client.py +7 -7
- oci/desktops/desktop_service_client.py +21 -21
- oci/devops/devops_client.py +141 -141
- oci/disaster_recovery/disaster_recovery_client.py +31 -31
- oci/distributed_database/__init__.py +20 -0
- oci/distributed_database/distributed_autonomous_db_service_client.py +2315 -0
- oci/distributed_database/distributed_autonomous_db_service_client_composite_operations.py +605 -0
- oci/distributed_database/distributed_db_private_endpoint_service_client.py +944 -0
- oci/distributed_database/distributed_db_private_endpoint_service_client_composite_operations.py +238 -0
- oci/distributed_database/distributed_db_service_client.py +2435 -0
- oci/distributed_database/distributed_db_service_client_composite_operations.py +647 -0
- oci/distributed_database/distributed_db_work_request_service_client.py +654 -0
- oci/distributed_database/distributed_db_work_request_service_client_composite_operations.py +26 -0
- oci/distributed_database/models/__init__.py +158 -0
- oci/distributed_database/models/add_distributed_autonomous_database_gds_control_node_details.py +105 -0
- oci/distributed_database/models/add_distributed_database_gds_control_node_details.py +105 -0
- oci/distributed_database/models/catalog_peer_with_dedicated_infra.py +331 -0
- oci/distributed_database/models/catalog_peer_with_exadb_xs.py +331 -0
- oci/distributed_database/models/change_distributed_autonomous_database_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_database_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_database_private_endpoint_compartment_details.py +74 -0
- oci/distributed_database/models/change_distributed_db_backup_config_details.py +66 -0
- oci/distributed_database/models/configure_distributed_autonomous_database_gsms_details.py +103 -0
- oci/distributed_database/models/configure_distributed_database_gsms_details.py +103 -0
- oci/distributed_database/models/create_distributed_autonomous_database_catalog_details.py +101 -0
- oci/distributed_database/models/create_distributed_autonomous_database_catalog_with_dedicated_infra_details.py +342 -0
- oci/distributed_database/models/create_distributed_autonomous_database_details.py +799 -0
- oci/distributed_database/models/create_distributed_autonomous_database_shard_details.py +101 -0
- oci/distributed_database/models/create_distributed_autonomous_database_shard_with_dedicated_infra_details.py +377 -0
- oci/distributed_database/models/create_distributed_database_catalog_details.py +99 -0
- oci/distributed_database/models/create_distributed_database_catalog_with_exadb_xs_details.py +282 -0
- oci/distributed_database/models/create_distributed_database_details.py +810 -0
- oci/distributed_database/models/create_distributed_database_private_endpoint_details.py +260 -0
- oci/distributed_database/models/create_distributed_database_shard_details.py +99 -0
- oci/distributed_database/models/create_distributed_database_shard_with_exadb_xs_details.py +282 -0
- oci/distributed_database/models/distributed_autonomous_database.py +1143 -0
- oci/distributed_database/models/distributed_autonomous_database_associated_with_private_endpoint.py +105 -0
- oci/distributed_database/models/distributed_autonomous_database_catalog.py +194 -0
- oci/distributed_database/models/distributed_autonomous_database_catalog_with_dedicated_infra.py +559 -0
- oci/distributed_database/models/distributed_autonomous_database_collection.py +70 -0
- oci/distributed_database/models/distributed_autonomous_database_connection_string.py +70 -0
- oci/distributed_database/models/distributed_autonomous_database_gsm.py +385 -0
- oci/distributed_database/models/distributed_autonomous_database_gsm_image.py +105 -0
- oci/distributed_database/models/distributed_autonomous_database_shard.py +194 -0
- oci/distributed_database/models/distributed_autonomous_database_shard_with_dedicated_infra.py +592 -0
- oci/distributed_database/models/distributed_autonomous_database_summary.py +935 -0
- oci/distributed_database/models/distributed_autonomous_db_metadata.py +70 -0
- oci/distributed_database/models/distributed_database.py +1154 -0
- oci/distributed_database/models/distributed_database_associated_with_private_endpoint.py +105 -0
- oci/distributed_database/models/distributed_database_catalog.py +192 -0
- oci/distributed_database/models/distributed_database_catalog_with_exadb_xs.py +466 -0
- oci/distributed_database/models/distributed_database_collection.py +70 -0
- oci/distributed_database/models/distributed_database_gsm.py +385 -0
- oci/distributed_database/models/distributed_database_private_endpoint.py +639 -0
- oci/distributed_database/models/distributed_database_private_endpoint_collection.py +70 -0
- oci/distributed_database/models/distributed_database_private_endpoint_summary.py +479 -0
- oci/distributed_database/models/distributed_database_shard.py +192 -0
- oci/distributed_database/models/distributed_database_shard_with_exadb_xs.py +499 -0
- oci/distributed_database/models/distributed_database_summary.py +904 -0
- oci/distributed_database/models/distributed_db_backup_config.py +536 -0
- oci/distributed_database/models/distributed_db_backup_destination.py +362 -0
- oci/distributed_database/models/distributed_db_connection_string.py +70 -0
- oci/distributed_database/models/distributed_db_gsm_image.py +105 -0
- oci/distributed_database/models/distributed_db_metadata.py +70 -0
- oci/distributed_database/models/generate_distributed_autonomous_database_wallet_details.py +70 -0
- oci/distributed_database/models/generate_distributed_database_wallet_details.py +70 -0
- oci/distributed_database/models/patch_distributed_autonomous_database_details.py +73 -0
- oci/distributed_database/models/patch_distributed_database_details.py +73 -0
- oci/distributed_database/models/patch_insert_instruction.py +87 -0
- oci/distributed_database/models/patch_instruction.py +154 -0
- oci/distributed_database/models/patch_merge_instruction.py +95 -0
- oci/distributed_database/models/patch_remove_instruction.py +57 -0
- oci/distributed_database/models/shard_peer_with_dedicated_infra.py +331 -0
- oci/distributed_database/models/shard_peer_with_exadb_xs.py +331 -0
- oci/distributed_database/models/update_distributed_autonomous_database_details.py +136 -0
- oci/distributed_database/models/update_distributed_database_details.py +136 -0
- oci/distributed_database/models/update_distributed_database_private_endpoint_details.py +198 -0
- oci/distributed_database/models/upload_distributed_autonomous_database_signed_certificate_and_generate_wallet_details.py +71 -0
- oci/distributed_database/models/upload_distributed_database_signed_certificate_and_generate_wallet_details.py +71 -0
- oci/distributed_database/models/work_request.py +516 -0
- oci/distributed_database/models/work_request_error.py +134 -0
- oci/distributed_database/models/work_request_error_collection.py +70 -0
- oci/distributed_database/models/work_request_log_entry.py +101 -0
- oci/distributed_database/models/work_request_log_entry_collection.py +70 -0
- oci/distributed_database/models/work_request_resource.py +232 -0
- oci/distributed_database/models/work_request_summary.py +516 -0
- oci/distributed_database/models/work_request_summary_collection.py +70 -0
- oci/dns/dns_client.py +54 -54
- oci/dts/appliance_export_job_client.py +6 -6
- oci/dts/shipping_vendors_client.py +1 -1
- oci/dts/transfer_appliance_client.py +8 -8
- oci/dts/transfer_appliance_entitlement_client.py +3 -3
- oci/dts/transfer_device_client.py +5 -5
- oci/dts/transfer_job_client.py +6 -6
- oci/dts/transfer_package_client.py +7 -7
- oci/em_warehouse/em_warehouse_client.py +13 -13
- oci/email/email_client.py +31 -31
- oci/email_data_plane/email_dp_client.py +1 -1
- oci/events/events_client.py +6 -6
- oci/file_storage/file_storage_client.py +74 -74
- oci/fleet_apps_management/fleet_apps_management_admin_client.py +27 -27
- oci/fleet_apps_management/fleet_apps_management_catalog_client.py +7 -7
- oci/fleet_apps_management/fleet_apps_management_client.py +32 -32
- oci/fleet_apps_management/fleet_apps_management_maintenance_window_client.py +5 -5
- oci/fleet_apps_management/fleet_apps_management_operations_client.py +29 -29
- oci/fleet_apps_management/fleet_apps_management_provision_client.py +6 -6
- oci/fleet_apps_management/fleet_apps_management_runbooks_client.py +19 -19
- oci/fleet_apps_management/fleet_apps_management_work_request_client.py +4 -4
- oci/fleet_software_update/fleet_software_update_client.py +46 -46
- oci/functions/functions_invoke_client.py +1 -1
- oci/functions/functions_management_client.py +16 -16
- oci/fusion_apps/fusion_applications_client.py +41 -41
- oci/generative_ai/generative_ai_client.py +22 -22
- oci/generative_ai/models/create_dedicated_ai_cluster_details.py +4 -0
- oci/generative_ai/models/dedicated_ai_cluster.py +11 -3
- oci/generative_ai_agent/generative_ai_agent_client.py +38 -38
- oci/generative_ai_agent_runtime/generative_ai_agent_runtime_client.py +6 -6
- oci/generative_ai_inference/generative_ai_inference_client.py +6 -6
- oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
- oci/globally_distributed_database/sharded_database_service_client.py +58 -58
- oci/golden_gate/golden_gate_client.py +89 -89
- oci/governance_rules_control_plane/governance_rule_client.py +15 -15
- oci/governance_rules_control_plane/work_request_client.py +5 -5
- oci/healthchecks/health_checks_client.py +17 -17
- oci/identity/identity_client.py +145 -145
- oci/identity_data_plane/dataplane_client.py +2 -2
- oci/identity_domains/identity_domains_client.py +311 -311
- oci/integration/integration_instance_client.py +19 -19
- oci/jms/java_management_service_client.py +79 -79
- oci/jms_java_downloads/java_download_client.py +25 -25
- oci/key_management/ekm_client.py +5 -5
- oci/key_management/kms_crypto_client.py +6 -6
- oci/key_management/kms_hsm_cluster_client.py +12 -12
- oci/key_management/kms_management_client.py +21 -21
- oci/key_management/kms_vault_client.py +14 -14
- oci/license_manager/license_manager_client.py +18 -18
- oci/limits/limits_client.py +4 -4
- oci/limits/quotas_client.py +7 -7
- oci/load_balancer/load_balancer_client.py +61 -61
- oci/lockbox/lockbox_client.py +24 -24
- oci/log_analytics/log_analytics_client.py +200 -200
- oci/logging/logging_management_client.py +30 -30
- oci/loggingingestion/logging_client.py +1 -1
- oci/loggingsearch/log_search_client.py +1 -1
- oci/lustre_file_storage/lustre_file_storage_client.py +11 -11
- oci/management_agent/management_agent_client.py +28 -28
- oci/management_dashboard/dashx_apis_client.py +14 -14
- oci/marketplace/account_client.py +2 -2
- oci/marketplace/marketplace_client.py +30 -30
- oci/marketplace_private_offer/attachment_client.py +5 -5
- oci/marketplace_private_offer/offer_client.py +6 -6
- oci/marketplace_publisher/attachment_client.py +5 -5
- oci/marketplace_publisher/marketplace_publisher_client.py +71 -71
- oci/marketplace_publisher/offer_client.py +6 -6
- oci/media_services/media_services_client.py +60 -60
- oci/media_services/media_stream_client.py +2 -2
- oci/mngdmac/mac_device_client.py +3 -3
- oci/mngdmac/mac_order_client.py +11 -11
- oci/model_deployment/__init__.py +14 -0
- oci/model_deployment/model_deployment_client.py +331 -0
- oci/model_deployment/model_deployment_client_composite_operations.py +26 -0
- oci/model_deployment/models/__init__.py +14 -0
- oci/model_deployment/models/inference_result.py +70 -0
- oci/monitoring/monitoring_client.py +18 -18
- oci/mysql/channels_client.py +7 -7
- oci/mysql/db_backups_client.py +7 -7
- oci/mysql/db_system_client.py +17 -17
- oci/mysql/models/create_db_system_details.py +31 -0
- oci/mysql/models/db_system.py +31 -0
- oci/mysql/models/db_system_snapshot.py +31 -0
- oci/mysql/models/replica.py +31 -0
- oci/mysql/models/replica_overrides.py +33 -2
- oci/mysql/models/replica_summary.py +31 -0
- oci/mysql/models/update_db_system_details.py +31 -0
- oci/mysql/mysqlaas_client.py +7 -7
- oci/mysql/replicas_client.py +5 -5
- oci/mysql/work_requests_client.py +4 -4
- oci/network_firewall/network_firewall_client.py +86 -86
- oci/network_load_balancer/network_load_balancer_client.py +35 -35
- oci/nosql/nosql_client.py +24 -24
- oci/object_storage/object_storage_client.py +55 -55
- oci/oce/oce_instance_client.py +10 -10
- oci/oci_control_center/occ_metrics_client.py +3 -3
- oci/ocvp/cluster_client.py +5 -5
- oci/ocvp/esxi_host_client.py +8 -8
- oci/ocvp/sddc_client.py +14 -14
- oci/ocvp/work_request_client.py +4 -4
- oci/oda/management_client.py +59 -59
- oci/oda/oda_client.py +17 -17
- oci/oda/odapackage_client.py +7 -7
- oci/onesubscription/billing_schedule_client.py +1 -1
- oci/onesubscription/commitment_client.py +2 -2
- oci/onesubscription/computed_usage_client.py +3 -3
- oci/onesubscription/invoice_summary_client.py +2 -2
- oci/onesubscription/organization_subscription_client.py +1 -1
- oci/onesubscription/ratecard_client.py +1 -1
- oci/onesubscription/subscribed_service_client.py +2 -2
- oci/onesubscription/subscription_client.py +1 -1
- oci/ons/notification_control_plane_client.py +6 -6
- oci/ons/notification_data_plane_client.py +10 -10
- oci/opa/opa_instance_client.py +13 -13
- oci/opensearch/models/__init__.py +2 -0
- oci/opensearch/models/create_opensearch_cluster_details.py +291 -0
- oci/opensearch/models/create_opensearch_cluster_pipeline_details.py +31 -0
- oci/opensearch/models/opensearch_cluster.py +291 -0
- oci/opensearch/models/opensearch_cluster_pipeline.py +31 -0
- oci/opensearch/models/opensearch_cluster_pipeline_summary.py +31 -0
- oci/opensearch/models/resize_opensearch_cluster_horizontal_details.py +31 -0
- oci/opensearch/models/resize_opensearch_cluster_vertical_details.py +217 -0
- oci/opensearch/models/shapes_details.py +70 -0
- oci/opensearch/models/update_cluster_specs_details.py +186 -0
- oci/opensearch/models/update_opensearch_cluster_pipeline_details.py +31 -0
- oci/opensearch/opensearch_cluster_backup_client.py +4 -4
- oci/opensearch/opensearch_cluster_client.py +87 -16
- oci/opensearch/opensearch_cluster_pipeline_client.py +5 -5
- oci/operator_access_control/access_requests_client.py +10 -10
- oci/operator_access_control/operator_actions_client.py +2 -2
- oci/operator_access_control/operator_control_assignment_client.py +8 -8
- oci/operator_access_control/operator_control_client.py +6 -6
- oci/opsi/operations_insights_client.py +181 -181
- oci/optimizer/optimizer_client.py +26 -26
- oci/os_management/event_client.py +8 -8
- oci/os_management/os_management_client.py +69 -69
- oci/os_management_hub/event_client.py +8 -8
- oci/os_management_hub/lifecycle_environment_client.py +13 -13
- oci/os_management_hub/managed_instance_client.py +33 -33
- oci/os_management_hub/managed_instance_group_client.py +26 -26
- oci/os_management_hub/management_station_client.py +10 -10
- oci/os_management_hub/onboarding_client.py +13 -13
- oci/os_management_hub/reporting_managed_instance_client.py +3 -3
- oci/os_management_hub/scheduled_job_client.py +7 -7
- oci/os_management_hub/software_source_client.py +33 -33
- oci/os_management_hub/work_request_client.py +5 -5
- oci/osp_gateway/address_rule_service_client.py +1 -1
- oci/osp_gateway/address_service_client.py +2 -2
- oci/osp_gateway/invoice_service_client.py +5 -5
- oci/osp_gateway/subscription_service_client.py +5 -5
- oci/osub_billing_schedule/billing_schedule_client.py +1 -1
- oci/osub_organization_subscription/organization_subscription_client.py +1 -1
- oci/osub_subscription/commitment_client.py +2 -2
- oci/osub_subscription/ratecard_client.py +1 -1
- oci/osub_subscription/subscription_client.py +1 -1
- oci/osub_usage/computed_usage_client.py +3 -3
- oci/psql/postgresql_client.py +34 -34
- oci/queue/queue_admin_client.py +11 -11
- oci/queue/queue_client.py +8 -8
- oci/recovery/database_recovery_client.py +26 -26
- oci/redis/redis_cluster_client.py +12 -12
- oci/resource_manager/resource_manager_client.py +52 -52
- oci/resource_scheduler/schedule_client.py +14 -14
- oci/resource_search/resource_search_client.py +3 -3
- oci/rover/rover_bundle_client.py +8 -8
- oci/rover/rover_cluster_client.py +8 -8
- oci/rover/rover_entitlement_client.py +6 -6
- oci/rover/rover_node_client.py +15 -15
- oci/rover/shape_client.py +1 -1
- oci/rover/work_requests_client.py +5 -5
- oci/sch/connector_plugins_client.py +2 -2
- oci/sch/service_connector_client.py +12 -12
- oci/secrets/secrets_client.py +3 -3
- oci/security_attribute/security_attribute_client.py +18 -18
- oci/service_catalog/service_catalog_client.py +26 -26
- oci/service_manager_proxy/service_manager_proxy_client.py +2 -2
- oci/service_mesh/service_mesh_client.py +48 -48
- oci/stack_monitoring/stack_monitoring_client.py +87 -87
- oci/streaming/stream_admin_client.py +18 -18
- oci/streaming/stream_client.py +8 -8
- oci/tenant_manager_control_plane/domain_client.py +5 -5
- oci/tenant_manager_control_plane/domain_governance_client.py +5 -5
- oci/tenant_manager_control_plane/governance_client.py +2 -2
- oci/tenant_manager_control_plane/link_client.py +3 -3
- oci/tenant_manager_control_plane/orders_client.py +2 -2
- oci/tenant_manager_control_plane/organization_client.py +10 -10
- oci/tenant_manager_control_plane/recipient_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/sender_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/subscription_client.py +11 -11
- oci/tenant_manager_control_plane/work_request_client.py +4 -4
- oci/threat_intelligence/threatintel_client.py +5 -5
- oci/usage/resources_client.py +2 -2
- oci/usage/rewards_client.py +6 -6
- oci/usage/usagelimits_client.py +1 -1
- oci/usage_api/usageapi_client.py +33 -33
- oci/vault/vaults_client.py +13 -13
- oci/vbs_inst/vbs_instance_client.py +10 -10
- oci/version.py +1 -1
- oci/visual_builder/vb_instance_client.py +14 -14
- oci/vn_monitoring/vn_monitoring_client.py +12 -12
- oci/vulnerability_scanning/vulnerability_scanning_client.py +58 -58
- oci/waa/waa_client.py +13 -13
- oci/waa/work_request_client.py +4 -4
- oci/waas/redirect_client.py +6 -6
- oci/waas/waas_client.py +66 -66
- oci/waf/waf_client.py +24 -24
- oci/work_requests/work_request_client.py +4 -4
- oci/zpr/zpr_client.py +15 -15
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/METADATA +6 -1
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/RECORD +428 -313
- oci/database_management/models/disable_external_mysql_associated_service_details.py +0 -144
- oci/database_management/models/enable_external_mysql_associated_service_details.py +0 -144
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/LICENSE.txt +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/WHEEL +0 -0
- {oci-2.151.0.dist-info → oci-2.152.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,334 @@
|
|
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 inspect import getdoc, ismethod, signature
|
6
|
+
from typing import Any, Callable, Dict, get_type_hints
|
7
|
+
|
8
|
+
from docstring_parser import parse
|
9
|
+
from pydantic import BaseModel, ConfigDict, Field, validate_call
|
10
|
+
|
11
|
+
from oci.addons.adk.logger import default_logger as logger
|
12
|
+
from oci.addons.adk.util import DocstringParser, JsonSchemaGenerator
|
13
|
+
|
14
|
+
|
15
|
+
class FunctionTool(BaseModel):
|
16
|
+
"""Represents a callable function with metadata for tool-based execution."""
|
17
|
+
|
18
|
+
name: str = Field(
|
19
|
+
description="The name of the tool, used for identification and invocation"
|
20
|
+
)
|
21
|
+
|
22
|
+
description: str = Field(
|
23
|
+
description="Human-readable description of what the tool does and how to use it"
|
24
|
+
)
|
25
|
+
|
26
|
+
parameters: Dict[str, Any] = Field(
|
27
|
+
default_factory=lambda: {"type": "object", "properties": {}, "required": []},
|
28
|
+
description="JSON Schema object describing function parameters, their types, and requirements", # noqa: E501
|
29
|
+
)
|
30
|
+
|
31
|
+
callable: Callable = Field(
|
32
|
+
description="The actual function that will be executed when the tool is invoked"
|
33
|
+
)
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def from_callable(
|
37
|
+
cls, callable_func: Callable, strict: bool = False
|
38
|
+
) -> "FunctionTool":
|
39
|
+
"""
|
40
|
+
Create a FunctionTool from a callable function,
|
41
|
+
using docstring for function description and parameter descriptions
|
42
|
+
|
43
|
+
Args:
|
44
|
+
callable_func: The function to convert to a tool
|
45
|
+
strict: If True, mark all parameters as required regardless of defaults
|
46
|
+
|
47
|
+
Returns:
|
48
|
+
A FunctionTool instance representing the callable
|
49
|
+
|
50
|
+
Raises:
|
51
|
+
ValueError: If the function is not marked as a tool
|
52
|
+
"""
|
53
|
+
# Verify the function is marked as a tool
|
54
|
+
if not hasattr(callable_func, "_is_tool"):
|
55
|
+
raise ValueError(
|
56
|
+
f"Function {callable_func.__name__} is not marked as a tool"
|
57
|
+
)
|
58
|
+
|
59
|
+
# Extract function name
|
60
|
+
# use _tool_name if provided, otherwise use the function's name
|
61
|
+
function_name = getattr(callable_func, "_tool_name", callable_func.__name__)
|
62
|
+
|
63
|
+
# Extract function description
|
64
|
+
# use _tool_description if provided, otherwise use the function's docstring
|
65
|
+
function_description = getattr(
|
66
|
+
callable_func,
|
67
|
+
"_tool_description",
|
68
|
+
DocstringParser.get_callable_description(callable_func),
|
69
|
+
)
|
70
|
+
|
71
|
+
# Build parameter schema
|
72
|
+
function_parameters = cls._build_parameter_schema(callable_func, strict)
|
73
|
+
|
74
|
+
return cls(
|
75
|
+
name=function_name,
|
76
|
+
description=function_description,
|
77
|
+
parameters=function_parameters,
|
78
|
+
callable=validate_call(config=ConfigDict(arbitrary_types_allowed=True))(
|
79
|
+
callable_func
|
80
|
+
),
|
81
|
+
)
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def from_callable_openai_tool(
|
85
|
+
cls, callable_func: Callable, openai_tool: Dict[str, Any], strict: bool = False
|
86
|
+
) -> "FunctionTool":
|
87
|
+
"""
|
88
|
+
Create a FunctionTool from a callable function
|
89
|
+
and dictionary loaded from an OpenAI JSON schema.
|
90
|
+
|
91
|
+
Args:
|
92
|
+
callable_func: The function to convert to a tool
|
93
|
+
openai_tool: Dictionary containing OpenAI JSON schema
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
A FunctionTool instance using the given callable
|
97
|
+
but with the OpenAI tool JSON schema
|
98
|
+
"""
|
99
|
+
|
100
|
+
# Verify the function is marked as a tool
|
101
|
+
if not hasattr(callable_func, "_is_tool"):
|
102
|
+
raise ValueError(
|
103
|
+
f"Function {callable_func.__name__} is not marked as a tool"
|
104
|
+
)
|
105
|
+
|
106
|
+
function_name = openai_tool.get("name")
|
107
|
+
function_description = openai_tool.get("description")
|
108
|
+
function_parameters_oai = openai_tool.get("parameters")
|
109
|
+
|
110
|
+
if (
|
111
|
+
not isinstance(function_parameters_oai, dict) or
|
112
|
+
function_name is None or
|
113
|
+
function_description is None
|
114
|
+
):
|
115
|
+
raise ValueError(
|
116
|
+
f"Invalid OpenAI tool schema: "
|
117
|
+
f"name: {function_name}, "
|
118
|
+
f"description: {function_description}, "
|
119
|
+
f"parameters: {function_parameters_oai}"
|
120
|
+
)
|
121
|
+
|
122
|
+
# validate the function parameters name
|
123
|
+
# and type are the same as the OpenAI tool parameters
|
124
|
+
function_parameters_func = cls._build_parameter_schema(callable_func, strict)
|
125
|
+
for param_name, param_type in function_parameters_func.get(
|
126
|
+
"properties", {}
|
127
|
+
).items():
|
128
|
+
if (
|
129
|
+
param_name not in function_parameters_oai.get("properties", {})
|
130
|
+
):
|
131
|
+
raise ValueError(
|
132
|
+
f"Local function and OpenAI tool parameters mismatch:"
|
133
|
+
f" Function parameter {param_name} of local function "
|
134
|
+
f"{callable_func.__name__} cannot be found "
|
135
|
+
"in the OpenAI tool parameters"
|
136
|
+
)
|
137
|
+
if param_type.get("type") != function_parameters_oai.get(
|
138
|
+
"properties", {}
|
139
|
+
).get(param_name).get("type"):
|
140
|
+
# Convert both 'integer' and OpenAI types to 'number'
|
141
|
+
local_type = (
|
142
|
+
"number"
|
143
|
+
if param_type.get("type") == "integer"
|
144
|
+
else param_type.get("type")
|
145
|
+
)
|
146
|
+
oai_type = (
|
147
|
+
"number"
|
148
|
+
if function_parameters_oai.get("properties", {})
|
149
|
+
.get(param_name)
|
150
|
+
.get("type") == "integer"
|
151
|
+
else function_parameters_oai.get("properties", {})
|
152
|
+
.get(param_name)
|
153
|
+
.get("type")
|
154
|
+
)
|
155
|
+
if local_type != oai_type:
|
156
|
+
raise ValueError(
|
157
|
+
f"Local function and OpenAI tool parameters mismatch: "
|
158
|
+
f" Function parameter {param_name} of local function "
|
159
|
+
f"{callable_func.__name__} has type {local_type} "
|
160
|
+
f" which does not match OpenAI tool parameter type {oai_type}"
|
161
|
+
)
|
162
|
+
|
163
|
+
# validate all parameters present in OpenAI tool parameters
|
164
|
+
# are present in the local function parameters
|
165
|
+
for param_name in function_parameters_oai.get("properties", {}):
|
166
|
+
if param_name not in function_parameters_func.get("properties", {}):
|
167
|
+
raise ValueError(
|
168
|
+
f"Local function and OpenAI tool parameters mismatch: "
|
169
|
+
f"Function parameter {param_name} is not "
|
170
|
+
"in the local function parameters"
|
171
|
+
)
|
172
|
+
|
173
|
+
return cls(
|
174
|
+
name=function_name,
|
175
|
+
description=function_description,
|
176
|
+
parameters=function_parameters_oai,
|
177
|
+
callable=validate_call(config=ConfigDict(arbitrary_types_allowed=True))(
|
178
|
+
callable_func
|
179
|
+
),
|
180
|
+
)
|
181
|
+
|
182
|
+
def execute(self, arguments: Dict[str, Any]) -> Any:
|
183
|
+
"""
|
184
|
+
Execute the function with the given arguments.
|
185
|
+
|
186
|
+
Args:
|
187
|
+
arguments: Dictionary of arguments to pass to the function
|
188
|
+
|
189
|
+
Returns:
|
190
|
+
The result of the function execution
|
191
|
+
|
192
|
+
Raises:
|
193
|
+
ValueError: If required arguments are missing or invalid
|
194
|
+
"""
|
195
|
+
# Clean and filter arguments
|
196
|
+
filtered_args = self._prepare_arguments(arguments)
|
197
|
+
|
198
|
+
# Invoke the callable with the filtered arguments
|
199
|
+
result = self.callable(**filtered_args)
|
200
|
+
|
201
|
+
return result
|
202
|
+
|
203
|
+
def to_dict(self) -> Dict[str, Any]:
|
204
|
+
"""Convert the tool to a dictionary representation, excluding the callable."""
|
205
|
+
return self.model_dump(
|
206
|
+
exclude_none=True, include={"name", "description", "parameters"}
|
207
|
+
)
|
208
|
+
|
209
|
+
# Private helper methods
|
210
|
+
def _prepare_arguments(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
211
|
+
"""
|
212
|
+
Clean and filter arguments for execution.
|
213
|
+
|
214
|
+
Args:
|
215
|
+
arguments: Raw arguments dictionary
|
216
|
+
|
217
|
+
Returns:
|
218
|
+
Cleaned and filtered arguments dictionary
|
219
|
+
"""
|
220
|
+
# Clean up argument keys - remove any trailing colons and whitespace
|
221
|
+
cleaned_args = {
|
222
|
+
key.rstrip(":").strip(): value for key, value in arguments.items()
|
223
|
+
}
|
224
|
+
|
225
|
+
# Filter out any arguments that aren't in the function's parameters
|
226
|
+
valid_params = self.parameters.get("properties", {}).keys()
|
227
|
+
return {k: v for k, v in cleaned_args.items() if k in valid_params}
|
228
|
+
|
229
|
+
@staticmethod
|
230
|
+
def _build_parameter_schema(
|
231
|
+
callable_func: Callable, strict: bool
|
232
|
+
) -> Dict[str, Any]:
|
233
|
+
"""
|
234
|
+
Build a JSON schema for the function's parameters.
|
235
|
+
|
236
|
+
Args:
|
237
|
+
callable_func: The function to analyze
|
238
|
+
strict: If True, mark all parameters as required
|
239
|
+
|
240
|
+
Returns:
|
241
|
+
A JSON schema object describing the function parameters
|
242
|
+
"""
|
243
|
+
parameters = {"type": "object", "properties": {}, "required": []}
|
244
|
+
|
245
|
+
try:
|
246
|
+
sig = signature(callable_func)
|
247
|
+
type_hints = get_type_hints(callable_func)
|
248
|
+
|
249
|
+
# If it's a bound method (like method of Toolkit),
|
250
|
+
# we need to get the original function's signature
|
251
|
+
if ismethod(callable_func):
|
252
|
+
sig = signature(callable_func.__func__)
|
253
|
+
type_hints = get_type_hints(callable_func.__func__)
|
254
|
+
|
255
|
+
# Remove agent parameter if present
|
256
|
+
if "agent" in sig.parameters:
|
257
|
+
type_hints.pop("agent", None)
|
258
|
+
|
259
|
+
# Filter out return type and only process parameters
|
260
|
+
param_type_hints = {
|
261
|
+
name: type_hints.get(name)
|
262
|
+
for name in sig.parameters
|
263
|
+
if name != "return" and name != "agent" and name != "self"
|
264
|
+
}
|
265
|
+
|
266
|
+
# Parse docstring for parameter descriptions
|
267
|
+
param_descriptions = FunctionTool._extract_param_descriptions(callable_func)
|
268
|
+
|
269
|
+
# Generate JSON schema for parameters
|
270
|
+
parameters = JsonSchemaGenerator.get_json_schema(
|
271
|
+
type_hints=param_type_hints,
|
272
|
+
param_descriptions=param_descriptions,
|
273
|
+
strict=strict,
|
274
|
+
)
|
275
|
+
|
276
|
+
logger.debug(f"Parameters: {parameters}")
|
277
|
+
|
278
|
+
# Determine required parameters
|
279
|
+
if strict:
|
280
|
+
parameters["required"] = [
|
281
|
+
name for name in parameters["properties"] if name != "agent"
|
282
|
+
]
|
283
|
+
else:
|
284
|
+
parameters["required"] = [
|
285
|
+
name
|
286
|
+
for name, param in sig.parameters.items()
|
287
|
+
if param.default == param.empty and
|
288
|
+
name != "self" and
|
289
|
+
name != "agent"
|
290
|
+
]
|
291
|
+
|
292
|
+
except Exception as e:
|
293
|
+
logger.print(
|
294
|
+
f"[yellow]Warning:[/] "
|
295
|
+
f"Could not parse args for {callable_func.__name__}: {e}"
|
296
|
+
)
|
297
|
+
|
298
|
+
return parameters
|
299
|
+
|
300
|
+
@staticmethod
|
301
|
+
def _extract_param_descriptions(callable_func: Callable) -> Dict[str, str]:
|
302
|
+
"""
|
303
|
+
Extract parameter descriptions from function docstring.
|
304
|
+
|
305
|
+
Args:
|
306
|
+
callable_func: The function to analyze
|
307
|
+
|
308
|
+
Returns:
|
309
|
+
Dictionary mapping parameter names to their descriptions
|
310
|
+
"""
|
311
|
+
param_descriptions = {}
|
312
|
+
if docstring := getdoc(callable_func):
|
313
|
+
parsed_doc = parse(docstring)
|
314
|
+
param_docs = parsed_doc.params
|
315
|
+
|
316
|
+
if param_docs is not None:
|
317
|
+
for param in param_docs:
|
318
|
+
param_name = param.arg_name
|
319
|
+
param_type = param.type_name
|
320
|
+
param_descriptions[param_name] = (
|
321
|
+
f"({param_type}) {param.description}"
|
322
|
+
)
|
323
|
+
|
324
|
+
return param_descriptions
|
325
|
+
|
326
|
+
# Equality comparison
|
327
|
+
def __eq__(self, other: object) -> bool:
|
328
|
+
if not isinstance(other, FunctionTool):
|
329
|
+
return NotImplemented
|
330
|
+
return (
|
331
|
+
self.name == other.name and
|
332
|
+
self.description == other.description and
|
333
|
+
self.parameters == other.parameters
|
334
|
+
)
|
@@ -0,0 +1,8 @@
|
|
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 .agentic_rag_tool import AgenticRagTool
|
6
|
+
from .calculator_toolkit import CalculatorToolkit
|
7
|
+
|
8
|
+
__all__ = ["AgenticRagTool", "CalculatorToolkit"]
|
@@ -0,0 +1,49 @@
|
|
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
|
+
A prebuilt toolkit for performing RAG
|
7
|
+
"""
|
8
|
+
|
9
|
+
from typing import List
|
10
|
+
|
11
|
+
from pydantic import BaseModel, Field
|
12
|
+
|
13
|
+
|
14
|
+
class AgenticRagTool(BaseModel):
|
15
|
+
"""A server-side tool that uses an agentic RAG pipeline to answer a question.
|
16
|
+
This tool is hosted in OCI Agent Platform, behind an provisioned agent endpoint.
|
17
|
+
|
18
|
+
This tool performs an agentic RAG that runs its own smart agentic loop workflow,
|
19
|
+
rather than a statically configured RAG, for best quality results.
|
20
|
+
"""
|
21
|
+
|
22
|
+
name: str = Field(
|
23
|
+
"RAG tool with Knowledge Bases",
|
24
|
+
description="The name of the tool, used for identification and invocation",
|
25
|
+
)
|
26
|
+
|
27
|
+
description: str = Field(
|
28
|
+
"""Use this tool to answer questions that require searching,
|
29
|
+
retrieving, and synthesizing information from knowledge bases.
|
30
|
+
This tool accesses specified knowledge bases to find relevant information
|
31
|
+
and generates comprehensive, accurate responses based on the retrieved content.
|
32
|
+
Ideal for questions about documents, policies, technical information,
|
33
|
+
or any data stored in the connected knowledge bases.""",
|
34
|
+
description="Human-readable description of what the tool does and how to use it", # noqa: E501
|
35
|
+
)
|
36
|
+
|
37
|
+
knowledge_base_ids: List[str] = Field(
|
38
|
+
description="A list of knowledge base IDs this RAG tool uses"
|
39
|
+
)
|
40
|
+
|
41
|
+
# Equality comparison
|
42
|
+
def __eq__(self, other: object) -> bool:
|
43
|
+
if not isinstance(other, AgenticRagTool):
|
44
|
+
return NotImplemented
|
45
|
+
return (
|
46
|
+
self.name == other.name and
|
47
|
+
self.description == other.description and
|
48
|
+
sorted(self.knowledge_base_ids) == sorted(other.knowledge_base_ids)
|
49
|
+
)
|
@@ -0,0 +1,104 @@
|
|
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
|
+
A prebuilt toolkit for performing calculations
|
7
|
+
"""
|
8
|
+
|
9
|
+
from oci.addons.adk.tool import Toolkit, tool
|
10
|
+
|
11
|
+
|
12
|
+
class CalculatorToolkit(Toolkit):
|
13
|
+
"""A toolkit for performing calculations"""
|
14
|
+
|
15
|
+
def __init__(self):
|
16
|
+
super().__init__()
|
17
|
+
|
18
|
+
@tool
|
19
|
+
def add(self, left: float, right: float) -> float:
|
20
|
+
"""Add two floats
|
21
|
+
|
22
|
+
Args:
|
23
|
+
left(float): The left operand
|
24
|
+
right(float): The right operand
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
The sum of the two operands
|
28
|
+
"""
|
29
|
+
return left + right
|
30
|
+
|
31
|
+
@tool
|
32
|
+
def subtract(self, left: float, right: float) -> float:
|
33
|
+
"""Subtract two floats
|
34
|
+
|
35
|
+
Args:
|
36
|
+
left(float): The left operand
|
37
|
+
right(float): The right operand
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
The difference of the two operands
|
41
|
+
"""
|
42
|
+
return left - right
|
43
|
+
|
44
|
+
@tool
|
45
|
+
def multiply(self, left: float, right: float) -> float:
|
46
|
+
"""Multiply two floats
|
47
|
+
|
48
|
+
Args:
|
49
|
+
left(float): The left operand
|
50
|
+
right(float): The right operand
|
51
|
+
|
52
|
+
Returns:
|
53
|
+
The product of the two operands
|
54
|
+
"""
|
55
|
+
return left * right
|
56
|
+
|
57
|
+
@tool
|
58
|
+
def divide(self, left: float, right: float) -> float:
|
59
|
+
"""Divide two floats
|
60
|
+
|
61
|
+
Args:
|
62
|
+
left(float): The left operand
|
63
|
+
right(float): The right operand
|
64
|
+
|
65
|
+
Returns:
|
66
|
+
The quotient of the two operands
|
67
|
+
"""
|
68
|
+
return left / right
|
69
|
+
|
70
|
+
@tool
|
71
|
+
def power(self, base: float, exponent: float) -> float:
|
72
|
+
"""Raise base to the power of exponent
|
73
|
+
|
74
|
+
Args:
|
75
|
+
base(float): The base
|
76
|
+
exponent(float): The exponent
|
77
|
+
|
78
|
+
Returns:
|
79
|
+
The result of raising the base to the power of the exponent
|
80
|
+
"""
|
81
|
+
return base**exponent
|
82
|
+
|
83
|
+
@tool
|
84
|
+
def sqrt(self, number: float) -> float:
|
85
|
+
"""Square root of a number
|
86
|
+
|
87
|
+
Args:
|
88
|
+
number(float): The number to square root
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
The square root of the number
|
92
|
+
"""
|
93
|
+
return number**0.5
|
94
|
+
|
95
|
+
def evaluate(self, expression: str) -> float:
|
96
|
+
"""A method that will not be registered as a tool
|
97
|
+
|
98
|
+
Args:
|
99
|
+
expression: The expression to evaluate
|
100
|
+
|
101
|
+
Returns:
|
102
|
+
The result of the expression
|
103
|
+
"""
|
104
|
+
raise NotImplementedError("This is not implemented")
|
@@ -0,0 +1,37 @@
|
|
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 functools import wraps
|
6
|
+
|
7
|
+
from oci.addons.adk.util import get_callable_description
|
8
|
+
|
9
|
+
|
10
|
+
def tool(func=None, *, name=None, description=None):
|
11
|
+
"""
|
12
|
+
Decorator to mark a function as a tool for the agent.
|
13
|
+
|
14
|
+
Args:
|
15
|
+
func: The function to decorate
|
16
|
+
name: Optional name for the tool (defaults to function name)
|
17
|
+
description: Optional description (defaults to function docstring)
|
18
|
+
"""
|
19
|
+
|
20
|
+
def decorator(func):
|
21
|
+
@wraps(func)
|
22
|
+
def wrapper(*args, **kwargs):
|
23
|
+
return func(*args, **kwargs)
|
24
|
+
|
25
|
+
# wrap the function with tool metadata
|
26
|
+
wrapper._is_tool = True
|
27
|
+
wrapper._tool_name = name or func.__name__
|
28
|
+
wrapper._tool_description = (
|
29
|
+
description or get_callable_description(callable_func=func) or ""
|
30
|
+
)
|
31
|
+
|
32
|
+
return wrapper
|
33
|
+
|
34
|
+
# Handle both @tool and @tool(name="name", description="desc") syntax
|
35
|
+
if func is None:
|
36
|
+
return decorator
|
37
|
+
return decorator(func)
|