oci 2.125.2__py3-none-any.whl → 2.125.3__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/access_governance_cp/access_governance_cp_client.py +8 -8
- 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 +22 -22
- oci/ai_language/ai_service_language_client.py +134 -43
- oci/ai_language/models/__init__.py +24 -0
- oci/ai_language/models/assertion_details.py +165 -0
- oci/ai_language/models/batch_detect_health_entity_details.py +223 -0
- oci/ai_language/models/batch_detect_health_entity_result.py +103 -0
- oci/ai_language/models/batch_detect_language_pii_entities_details.py +29 -2
- oci/ai_language/models/health_entity.py +351 -0
- oci/ai_language/models/health_entity_document_result.py +200 -0
- oci/ai_language/models/input_location.py +2 -1
- oci/ai_language/models/mel_concept.py +103 -0
- oci/ai_language/models/mel_concept_details.py +165 -0
- oci/ai_language/models/model_details.py +11 -3
- oci/ai_language/models/named_entity_recognition_model_details.py +1 -1
- oci/ai_language/models/pii_entity.py +118 -7
- oci/ai_language/models/pii_model_details.py +91 -0
- oci/ai_language/models/pre_trained_health_nlu_model_details.py +1 -1
- oci/ai_language/models/pre_trained_key_phrase_extraction_model_details.py +1 -1
- oci/ai_language/models/pre_trained_language_detection_model_details.py +1 -1
- oci/ai_language/models/pre_trained_named_entity_recognition_model_details.py +1 -1
- oci/ai_language/models/pre_trained_pii_model_details.py +1 -1
- oci/ai_language/models/pre_trained_sentiment_analysis_model_details.py +1 -1
- oci/ai_language/models/pre_trained_summarization.py +1 -1
- oci/ai_language/models/pre_trained_text_classification_model_details.py +1 -1
- oci/ai_language/models/pre_trained_universal_model.py +1 -1
- oci/ai_language/models/profile.py +134 -0
- oci/ai_language/models/relation_entity.py +196 -0
- oci/ai_language/models/resolved_entities.py +72 -0
- oci/ai_language/models/resolved_entity.py +227 -0
- oci/ai_language/models/text_classification_model_details.py +1 -1
- oci/ai_speech/ai_service_speech_client.py +10 -10
- oci/ai_vision/ai_service_vision_client.py +25 -25
- oci/analytics/analytics_client.py +23 -23
- oci/announcements_service/announcement_client.py +4 -4
- oci/announcements_service/announcement_subscription_client.py +9 -9
- oci/announcements_service/announcements_preferences_client.py +4 -4
- 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 +8 -8
- 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/application_migration/application_migration_client.py +19 -19
- 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 +51 -51
- oci/blockchain/blockchain_platform_client.py +27 -27
- oci/budget/budget_client.py +10 -10
- oci/capacity_management/capacity_management_client.py +19 -19
- oci/certificates/certificates_client.py +5 -5
- oci/certificates_management/certificates_management_client.py +32 -32
- oci/cims/incident_client.py +8 -8
- oci/cims/user_client.py +1 -1
- oci/cloud_bridge/common_client.py +5 -5
- oci/cloud_bridge/discovery_client.py +14 -14
- 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 +133 -133
- oci/cloud_migrations/migration_client.py +43 -43
- 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 +44 -44
- oci/container_instances/container_instance_client.py +18 -18
- oci/core/blockstorage_client.py +60 -60
- oci/core/compute_client.py +99 -99
- oci/core/compute_management_client.py +32 -32
- oci/core/virtual_network_client.py +242 -242
- oci/dashboard_service/dashboard_client.py +6 -6
- oci/dashboard_service/dashboard_group_client.py +6 -6
- oci/data_catalog/data_catalog_client.py +148 -148
- oci/data_flow/data_flow_client.py +42 -42
- 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 +272 -272
- oci/data_science/data_science_client.py +91 -91
- oci/data_science/models/instance_configuration.py +37 -2
- oci/database/database_client.py +1224 -537
- oci/database/database_client_composite_operations.py +204 -0
- oci/database/models/__init__.py +12 -0
- oci/database/models/autonomous_container_database.py +31 -0
- oci/database/models/autonomous_container_database_summary.py +31 -0
- oci/database/models/autonomous_database_software_image.py +489 -0
- oci/database/models/autonomous_database_software_image_collection.py +72 -0
- oci/database/models/autonomous_database_software_image_summary.py +437 -0
- oci/database/models/change_autonomous_database_software_image_compartment_details.py +76 -0
- oci/database/models/create_autonomous_container_database_details.py +35 -0
- oci/database/models/create_autonomous_database_software_image_details.py +267 -0
- oci/database/models/maintenance_window.py +33 -2
- oci/database/models/update_autonomous_database_software_image_details.py +119 -0
- oci/database_management/db_management_client.py +194 -194
- oci/database_management/diagnosability_client.py +4 -4
- oci/database_management/managed_my_sql_databases_client.py +7 -7
- oci/database_management/perfhub_client.py +1 -1
- oci/database_management/sql_tuning_client.py +17 -17
- oci/database_migration/database_migration_client.py +41 -41
- oci/database_migration/models/aws_s3_data_transfer_medium_details.py +29 -2
- oci/database_migration/models/data_transfer_medium_details_v2.py +1 -1
- oci/database_migration/models/nfs_data_transfer_medium_details.py +29 -2
- oci/database_tools/database_tools_client.py +23 -23
- oci/desktops/desktop_service_client.py +21 -21
- oci/devops/devops_client.py +89 -89
- oci/disaster_recovery/disaster_recovery_client.py +29 -29
- oci/dns/dns_client.py +52 -52
- 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_data_lake_client.py +13 -13
- oci/em_warehouse/em_warehouse_client.py +13 -13
- oci/email/email_client.py +26 -26
- oci/email_data_plane/email_dp_client.py +1 -1
- oci/events/events_client.py +6 -6
- oci/file_storage/file_storage_client.py +50 -50
- oci/fleet_software_update/fleet_software_update_client.py +44 -44
- oci/functions/functions_invoke_client.py +1 -1
- oci/functions/functions_management_client.py +16 -16
- oci/fusion_apps/data_masking_activity_client.py +3 -3
- oci/fusion_apps/fusion_applications_client.py +39 -39
- oci/fusion_apps/fusion_environment_client.py +15 -15
- oci/fusion_apps/fusion_environment_family_client.py +8 -8
- oci/fusion_apps/refresh_activity_client.py +4 -4
- oci/fusion_apps/scheduled_activity_client.py +2 -2
- oci/fusion_apps/service_attachment_client.py +2 -2
- oci/generative_ai/generative_ai_client.py +24 -24
- oci/generative_ai/models/dataset.py +1 -1
- oci/generative_ai/models/dedicated_ai_cluster.py +34 -3
- oci/generative_ai/models/endpoint.py +27 -0
- oci/generative_ai/models/model.py +34 -3
- oci/generative_ai/models/model_summary.py +7 -3
- oci/generative_ai_inference/generative_ai_inference_client.py +101 -3
- oci/generative_ai_inference/models/__init__.py +30 -0
- oci/generative_ai_inference/models/base_chat_request.py +109 -0
- oci/generative_ai_inference/models/base_chat_response.py +109 -0
- oci/generative_ai_inference/models/chat_choice.py +161 -0
- oci/generative_ai_inference/models/chat_content.py +101 -0
- oci/generative_ai_inference/models/chat_details.py +126 -0
- oci/generative_ai_inference/models/chat_result.py +130 -0
- oci/generative_ai_inference/models/citation.py +165 -0
- oci/generative_ai_inference/models/cohere_chat_request.py +443 -0
- oci/generative_ai_inference/models/cohere_chat_response.py +272 -0
- oci/generative_ai_inference/models/cohere_llm_inference_response.py +1 -1
- oci/generative_ai_inference/models/cohere_message.py +119 -0
- oci/generative_ai_inference/models/embed_text_details.py +2 -2
- oci/generative_ai_inference/models/generic_chat_request.py +474 -0
- oci/generative_ai_inference/models/generic_chat_response.py +113 -0
- oci/generative_ai_inference/models/llama_llm_inference_request.py +2 -2
- oci/generative_ai_inference/models/llama_llm_inference_response.py +1 -1
- oci/generative_ai_inference/models/llm_inference_response.py +11 -3
- oci/generative_ai_inference/models/message.py +103 -0
- oci/generative_ai_inference/models/search_query.py +72 -0
- oci/generative_ai_inference/models/text_content.py +82 -0
- oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
- oci/globally_distributed_database/sharded_database_service_client.py +29 -29
- oci/golden_gate/golden_gate_client.py +61 -61
- 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 +300 -300
- oci/integration/integration_instance_client.py +15 -15
- oci/jms/java_management_service_client.py +66 -66
- 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 +23 -23
- oci/log_analytics/log_analytics_client.py +193 -193
- oci/logging/logging_management_client.py +30 -30
- oci/loggingingestion/logging_client.py +1 -1
- oci/loggingsearch/log_search_client.py +1 -1
- 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_publisher/marketplace_publisher_client.py +71 -71
- oci/media_services/media_services_client.py +60 -60
- oci/media_services/media_stream_client.py +2 -2
- oci/monitoring/monitoring_client.py +18 -18
- oci/mysql/channels_client.py +7 -7
- oci/mysql/db_backups_client.py +6 -6
- oci/mysql/db_system_client.py +17 -17
- 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 +80 -80
- oci/network_load_balancer/network_load_balancer_client.py +34 -34
- oci/nosql/nosql_client.py +24 -24
- oci/object_storage/object_storage_client.py +50 -50
- 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/models/opa_instance.py +7 -3
- oci/opa/models/work_request.py +11 -3
- oci/opa/models/work_request_summary.py +11 -3
- oci/opa/opa_instance_client.py +223 -13
- oci/opa/opa_instance_client_composite_operations.py +78 -0
- oci/opensearch/opensearch_cluster_backup_client.py +4 -4
- oci/opensearch/opensearch_cluster_client.py +14 -14
- 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 +175 -175
- 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/lifecycle_environment_client.py +11 -11
- oci/os_management_hub/managed_instance_client.py +22 -22
- oci/os_management_hub/managed_instance_group_client.py +22 -22
- oci/os_management_hub/management_station_client.py +8 -8
- oci/os_management_hub/onboarding_client.py +5 -5
- oci/os_management_hub/reporting_managed_instance_client.py +3 -3
- oci/os_management_hub/scheduled_job_client.py +6 -6
- oci/os_management_hub/software_source_client.py +22 -22
- oci/os_management_hub/work_request_client.py +4 -4
- 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 +33 -33
- oci/queue/queue_admin_client.py +11 -11
- oci/queue/queue_client.py +8 -8
- oci/recovery/database_recovery_client.py +23 -23
- oci/redis/models/create_redis_cluster_details.py +31 -0
- oci/redis/models/redis_cluster.py +31 -0
- oci/redis/models/redis_cluster_summary.py +31 -0
- oci/redis/models/update_redis_cluster_details.py +31 -0
- oci/redis/redis_cluster_client.py +11 -11
- oci/resource_manager/resource_manager_client.py +52 -52
- 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/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 +64 -64
- 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/models/__init__.py +12 -0
- oci/usage_api/models/create_email_recipients_group_details.py +103 -0
- oci/usage_api/models/email_recipient.py +181 -0
- oci/usage_api/models/email_recipients_group.py +181 -0
- oci/usage_api/models/email_recipients_group_collection.py +72 -0
- oci/usage_api/models/email_recipients_group_summary.py +272 -0
- oci/usage_api/models/update_email_recipients_group_details.py +72 -0
- oci/usage_api/usageapi_client.py +656 -34
- oci/usage_api/usageapi_client_composite_operations.py +96 -0
- 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 +13 -13
- 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-2.125.2.dist-info → oci-2.125.3.dist-info}/METADATA +1 -1
- {oci-2.125.2.dist-info → oci-2.125.3.dist-info}/RECORD +333 -294
- {oci-2.125.2.dist-info → oci-2.125.3.dist-info}/LICENSE.txt +0 -0
- {oci-2.125.2.dist-info → oci-2.125.3.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci-2.125.2.dist-info → oci-2.125.3.dist-info}/WHEEL +0 -0
- {oci-2.125.2.dist-info → oci-2.125.3.dist-info}/top_level.txt +0 -0
@@ -122,6 +122,104 @@ class GenerativeAiInferenceClient(object):
|
|
122
122
|
self.retry_strategy = kwargs.get('retry_strategy')
|
123
123
|
self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback')
|
124
124
|
|
125
|
+
def chat(self, chat_details, **kwargs):
|
126
|
+
"""
|
127
|
+
Creates a response for the given conversation.
|
128
|
+
|
129
|
+
|
130
|
+
:param oci.generative_ai_inference.models.ChatDetails chat_details: (required)
|
131
|
+
Details of the conversation for the model to respond.
|
132
|
+
|
133
|
+
:param str opc_retry_token: (optional)
|
134
|
+
A token that uniquely identifies a request so it can be retried in case of a timeout or
|
135
|
+
server error without risk of executing that same action again. Retry tokens expire after 24
|
136
|
+
hours, but can be invalidated before then due to conflicting operations. For example, if a resource
|
137
|
+
has been deleted and purged from the system, then a retry of the original creation request
|
138
|
+
might be rejected.
|
139
|
+
|
140
|
+
:param str opc_request_id: (optional)
|
141
|
+
The client request ID for tracing.
|
142
|
+
|
143
|
+
:param obj retry_strategy: (optional)
|
144
|
+
A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
|
145
|
+
|
146
|
+
This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
|
147
|
+
The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.
|
148
|
+
|
149
|
+
To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.
|
150
|
+
|
151
|
+
:param bool allow_control_chars: (optional)
|
152
|
+
allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
|
153
|
+
By default, the response will not allow control characters in strings
|
154
|
+
|
155
|
+
:return: A :class:`~oci.response.Response` object with data of type :class:`~oci.generative_ai_inference.models.ChatResult`
|
156
|
+
:rtype: :class:`~oci.response.Response`
|
157
|
+
|
158
|
+
:example:
|
159
|
+
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.3/generativeaiinference/chat.py.html>`__ to see an example of how to use chat API.
|
160
|
+
"""
|
161
|
+
# Required path and query arguments. These are in camelCase to replace values in service endpoints.
|
162
|
+
required_arguments = []
|
163
|
+
resource_path = "/actions/chat"
|
164
|
+
method = "POST"
|
165
|
+
operation_name = "chat"
|
166
|
+
api_reference_link = "https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/20231130/ChatResult/Chat"
|
167
|
+
|
168
|
+
# Don't accept unknown kwargs
|
169
|
+
expected_kwargs = [
|
170
|
+
"allow_control_chars",
|
171
|
+
"retry_strategy",
|
172
|
+
"opc_retry_token",
|
173
|
+
"opc_request_id"
|
174
|
+
]
|
175
|
+
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
|
176
|
+
if extra_kwargs:
|
177
|
+
raise ValueError(
|
178
|
+
f"chat got unknown kwargs: {extra_kwargs!r}")
|
179
|
+
|
180
|
+
header_params = {
|
181
|
+
"accept": "application/json, text/event-stream",
|
182
|
+
"content-type": "application/json",
|
183
|
+
"opc-retry-token": kwargs.get("opc_retry_token", missing),
|
184
|
+
"opc-request-id": kwargs.get("opc_request_id", missing)
|
185
|
+
}
|
186
|
+
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
|
187
|
+
|
188
|
+
retry_strategy = self.base_client.get_preferred_retry_strategy(
|
189
|
+
operation_retry_strategy=kwargs.get('retry_strategy'),
|
190
|
+
client_retry_strategy=self.retry_strategy
|
191
|
+
)
|
192
|
+
if retry_strategy is None:
|
193
|
+
retry_strategy = retry.DEFAULT_RETRY_STRATEGY
|
194
|
+
|
195
|
+
if retry_strategy:
|
196
|
+
if not isinstance(retry_strategy, retry.NoneRetryStrategy):
|
197
|
+
self.base_client.add_opc_retry_token_if_needed(header_params)
|
198
|
+
self.base_client.add_opc_client_retries_header(header_params)
|
199
|
+
retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback)
|
200
|
+
return retry_strategy.make_retrying_call(
|
201
|
+
self.base_client.call_api,
|
202
|
+
resource_path=resource_path,
|
203
|
+
method=method,
|
204
|
+
header_params=header_params,
|
205
|
+
body=chat_details,
|
206
|
+
response_type="ChatResult",
|
207
|
+
allow_control_chars=kwargs.get('allow_control_chars'),
|
208
|
+
operation_name=operation_name,
|
209
|
+
api_reference_link=api_reference_link,
|
210
|
+
required_arguments=required_arguments)
|
211
|
+
else:
|
212
|
+
return self.base_client.call_api(
|
213
|
+
resource_path=resource_path,
|
214
|
+
method=method,
|
215
|
+
header_params=header_params,
|
216
|
+
body=chat_details,
|
217
|
+
response_type="ChatResult",
|
218
|
+
allow_control_chars=kwargs.get('allow_control_chars'),
|
219
|
+
operation_name=operation_name,
|
220
|
+
api_reference_link=api_reference_link,
|
221
|
+
required_arguments=required_arguments)
|
222
|
+
|
125
223
|
def embed_text(self, embed_text_details, **kwargs):
|
126
224
|
"""
|
127
225
|
Produces embeddings for the inputs.
|
@@ -158,7 +256,7 @@ class GenerativeAiInferenceClient(object):
|
|
158
256
|
:rtype: :class:`~oci.response.Response`
|
159
257
|
|
160
258
|
:example:
|
161
|
-
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.
|
259
|
+
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.3/generativeaiinference/embed_text.py.html>`__ to see an example of how to use embed_text API.
|
162
260
|
"""
|
163
261
|
# Required path and query arguments. These are in camelCase to replace values in service endpoints.
|
164
262
|
required_arguments = []
|
@@ -256,7 +354,7 @@ class GenerativeAiInferenceClient(object):
|
|
256
354
|
:rtype: :class:`~oci.response.Response`
|
257
355
|
|
258
356
|
:example:
|
259
|
-
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.
|
357
|
+
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.3/generativeaiinference/generate_text.py.html>`__ to see an example of how to use generate_text API.
|
260
358
|
"""
|
261
359
|
# Required path and query arguments. These are in camelCase to replace values in service endpoints.
|
262
360
|
required_arguments = []
|
@@ -354,7 +452,7 @@ class GenerativeAiInferenceClient(object):
|
|
354
452
|
:rtype: :class:`~oci.response.Response`
|
355
453
|
|
356
454
|
:example:
|
357
|
-
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.
|
455
|
+
Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.125.3/generativeaiinference/summarize_text.py.html>`__ to see an example of how to use summarize_text API.
|
358
456
|
"""
|
359
457
|
# Required path and query arguments. These are in camelCase to replace values in service endpoints.
|
360
458
|
required_arguments = []
|
@@ -6,45 +6,75 @@
|
|
6
6
|
|
7
7
|
from __future__ import absolute_import
|
8
8
|
|
9
|
+
from .base_chat_request import BaseChatRequest
|
10
|
+
from .base_chat_response import BaseChatResponse
|
11
|
+
from .chat_choice import ChatChoice
|
12
|
+
from .chat_content import ChatContent
|
13
|
+
from .chat_details import ChatDetails
|
14
|
+
from .chat_result import ChatResult
|
9
15
|
from .choice import Choice
|
16
|
+
from .citation import Citation
|
17
|
+
from .cohere_chat_request import CohereChatRequest
|
18
|
+
from .cohere_chat_response import CohereChatResponse
|
10
19
|
from .cohere_llm_inference_request import CohereLlmInferenceRequest
|
11
20
|
from .cohere_llm_inference_response import CohereLlmInferenceResponse
|
21
|
+
from .cohere_message import CohereMessage
|
12
22
|
from .dedicated_serving_mode import DedicatedServingMode
|
13
23
|
from .embed_text_details import EmbedTextDetails
|
14
24
|
from .embed_text_result import EmbedTextResult
|
15
25
|
from .generate_text_details import GenerateTextDetails
|
16
26
|
from .generate_text_result import GenerateTextResult
|
17
27
|
from .generated_text import GeneratedText
|
28
|
+
from .generic_chat_request import GenericChatRequest
|
29
|
+
from .generic_chat_response import GenericChatResponse
|
18
30
|
from .llama_llm_inference_request import LlamaLlmInferenceRequest
|
19
31
|
from .llama_llm_inference_response import LlamaLlmInferenceResponse
|
20
32
|
from .llm_inference_request import LlmInferenceRequest
|
21
33
|
from .llm_inference_response import LlmInferenceResponse
|
22
34
|
from .logprobs import Logprobs
|
35
|
+
from .message import Message
|
23
36
|
from .on_demand_serving_mode import OnDemandServingMode
|
37
|
+
from .search_query import SearchQuery
|
24
38
|
from .serving_mode import ServingMode
|
25
39
|
from .summarize_text_details import SummarizeTextDetails
|
26
40
|
from .summarize_text_result import SummarizeTextResult
|
41
|
+
from .text_content import TextContent
|
27
42
|
from .token_likelihood import TokenLikelihood
|
28
43
|
|
29
44
|
# Maps type names to classes for generative_ai_inference services.
|
30
45
|
generative_ai_inference_type_mapping = {
|
46
|
+
"BaseChatRequest": BaseChatRequest,
|
47
|
+
"BaseChatResponse": BaseChatResponse,
|
48
|
+
"ChatChoice": ChatChoice,
|
49
|
+
"ChatContent": ChatContent,
|
50
|
+
"ChatDetails": ChatDetails,
|
51
|
+
"ChatResult": ChatResult,
|
31
52
|
"Choice": Choice,
|
53
|
+
"Citation": Citation,
|
54
|
+
"CohereChatRequest": CohereChatRequest,
|
55
|
+
"CohereChatResponse": CohereChatResponse,
|
32
56
|
"CohereLlmInferenceRequest": CohereLlmInferenceRequest,
|
33
57
|
"CohereLlmInferenceResponse": CohereLlmInferenceResponse,
|
58
|
+
"CohereMessage": CohereMessage,
|
34
59
|
"DedicatedServingMode": DedicatedServingMode,
|
35
60
|
"EmbedTextDetails": EmbedTextDetails,
|
36
61
|
"EmbedTextResult": EmbedTextResult,
|
37
62
|
"GenerateTextDetails": GenerateTextDetails,
|
38
63
|
"GenerateTextResult": GenerateTextResult,
|
39
64
|
"GeneratedText": GeneratedText,
|
65
|
+
"GenericChatRequest": GenericChatRequest,
|
66
|
+
"GenericChatResponse": GenericChatResponse,
|
40
67
|
"LlamaLlmInferenceRequest": LlamaLlmInferenceRequest,
|
41
68
|
"LlamaLlmInferenceResponse": LlamaLlmInferenceResponse,
|
42
69
|
"LlmInferenceRequest": LlmInferenceRequest,
|
43
70
|
"LlmInferenceResponse": LlmInferenceResponse,
|
44
71
|
"Logprobs": Logprobs,
|
72
|
+
"Message": Message,
|
45
73
|
"OnDemandServingMode": OnDemandServingMode,
|
74
|
+
"SearchQuery": SearchQuery,
|
46
75
|
"ServingMode": ServingMode,
|
47
76
|
"SummarizeTextDetails": SummarizeTextDetails,
|
48
77
|
"SummarizeTextResult": SummarizeTextResult,
|
78
|
+
"TextContent": TextContent,
|
49
79
|
"TokenLikelihood": TokenLikelihood
|
50
80
|
}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2024, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130
|
6
|
+
|
7
|
+
|
8
|
+
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
|
9
|
+
from oci.decorators import init_model_state_from_kwargs
|
10
|
+
|
11
|
+
|
12
|
+
@init_model_state_from_kwargs
|
13
|
+
class BaseChatRequest(object):
|
14
|
+
"""
|
15
|
+
Base class for chat inference requests
|
16
|
+
"""
|
17
|
+
|
18
|
+
#: A constant which can be used with the api_format property of a BaseChatRequest.
|
19
|
+
#: This constant has a value of "COHERE"
|
20
|
+
API_FORMAT_COHERE = "COHERE"
|
21
|
+
|
22
|
+
#: A constant which can be used with the api_format property of a BaseChatRequest.
|
23
|
+
#: This constant has a value of "GENERIC"
|
24
|
+
API_FORMAT_GENERIC = "GENERIC"
|
25
|
+
|
26
|
+
def __init__(self, **kwargs):
|
27
|
+
"""
|
28
|
+
Initializes a new BaseChatRequest object with values from keyword arguments. This class has the following subclasses and if you are using this class as input
|
29
|
+
to a service operations then you should favor using a subclass over the base class:
|
30
|
+
|
31
|
+
* :class:`~oci.generative_ai_inference.models.GenericChatRequest`
|
32
|
+
* :class:`~oci.generative_ai_inference.models.CohereChatRequest`
|
33
|
+
|
34
|
+
The following keyword arguments are supported (corresponding to the getters/setters of this class):
|
35
|
+
|
36
|
+
:param api_format:
|
37
|
+
The value to assign to the api_format property of this BaseChatRequest.
|
38
|
+
Allowed values for this property are: "COHERE", "GENERIC"
|
39
|
+
:type api_format: str
|
40
|
+
|
41
|
+
"""
|
42
|
+
self.swagger_types = {
|
43
|
+
'api_format': 'str'
|
44
|
+
}
|
45
|
+
|
46
|
+
self.attribute_map = {
|
47
|
+
'api_format': 'apiFormat'
|
48
|
+
}
|
49
|
+
|
50
|
+
self._api_format = None
|
51
|
+
|
52
|
+
@staticmethod
|
53
|
+
def get_subtype(object_dictionary):
|
54
|
+
"""
|
55
|
+
Given the hash representation of a subtype of this class,
|
56
|
+
use the info in the hash to return the class of the subtype.
|
57
|
+
"""
|
58
|
+
type = object_dictionary['apiFormat']
|
59
|
+
|
60
|
+
if type == 'GENERIC':
|
61
|
+
return 'GenericChatRequest'
|
62
|
+
|
63
|
+
if type == 'COHERE':
|
64
|
+
return 'CohereChatRequest'
|
65
|
+
else:
|
66
|
+
return 'BaseChatRequest'
|
67
|
+
|
68
|
+
@property
|
69
|
+
def api_format(self):
|
70
|
+
"""
|
71
|
+
**[Required]** Gets the api_format of this BaseChatRequest.
|
72
|
+
The api format for the model's request
|
73
|
+
|
74
|
+
Allowed values for this property are: "COHERE", "GENERIC"
|
75
|
+
|
76
|
+
|
77
|
+
:return: The api_format of this BaseChatRequest.
|
78
|
+
:rtype: str
|
79
|
+
"""
|
80
|
+
return self._api_format
|
81
|
+
|
82
|
+
@api_format.setter
|
83
|
+
def api_format(self, api_format):
|
84
|
+
"""
|
85
|
+
Sets the api_format of this BaseChatRequest.
|
86
|
+
The api format for the model's request
|
87
|
+
|
88
|
+
|
89
|
+
:param api_format: The api_format of this BaseChatRequest.
|
90
|
+
:type: str
|
91
|
+
"""
|
92
|
+
allowed_values = ["COHERE", "GENERIC"]
|
93
|
+
if not value_allowed_none_or_none_sentinel(api_format, allowed_values):
|
94
|
+
raise ValueError(
|
95
|
+
f"Invalid value for `api_format`, must be None or one of {allowed_values}"
|
96
|
+
)
|
97
|
+
self._api_format = api_format
|
98
|
+
|
99
|
+
def __repr__(self):
|
100
|
+
return formatted_flat_dict(self)
|
101
|
+
|
102
|
+
def __eq__(self, other):
|
103
|
+
if other is None:
|
104
|
+
return False
|
105
|
+
|
106
|
+
return self.__dict__ == other.__dict__
|
107
|
+
|
108
|
+
def __ne__(self, other):
|
109
|
+
return not self == other
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2024, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130
|
6
|
+
|
7
|
+
|
8
|
+
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
|
9
|
+
from oci.decorators import init_model_state_from_kwargs
|
10
|
+
|
11
|
+
|
12
|
+
@init_model_state_from_kwargs
|
13
|
+
class BaseChatResponse(object):
|
14
|
+
"""
|
15
|
+
Base class for chat inference response
|
16
|
+
"""
|
17
|
+
|
18
|
+
#: A constant which can be used with the api_format property of a BaseChatResponse.
|
19
|
+
#: This constant has a value of "COHERE"
|
20
|
+
API_FORMAT_COHERE = "COHERE"
|
21
|
+
|
22
|
+
#: A constant which can be used with the api_format property of a BaseChatResponse.
|
23
|
+
#: This constant has a value of "GENERIC"
|
24
|
+
API_FORMAT_GENERIC = "GENERIC"
|
25
|
+
|
26
|
+
def __init__(self, **kwargs):
|
27
|
+
"""
|
28
|
+
Initializes a new BaseChatResponse object with values from keyword arguments. This class has the following subclasses and if you are using this class as input
|
29
|
+
to a service operations then you should favor using a subclass over the base class:
|
30
|
+
|
31
|
+
* :class:`~oci.generative_ai_inference.models.GenericChatResponse`
|
32
|
+
* :class:`~oci.generative_ai_inference.models.CohereChatResponse`
|
33
|
+
|
34
|
+
The following keyword arguments are supported (corresponding to the getters/setters of this class):
|
35
|
+
|
36
|
+
:param api_format:
|
37
|
+
The value to assign to the api_format property of this BaseChatResponse.
|
38
|
+
Allowed values for this property are: "COHERE", "GENERIC", 'UNKNOWN_ENUM_VALUE'.
|
39
|
+
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
|
40
|
+
:type api_format: str
|
41
|
+
|
42
|
+
"""
|
43
|
+
self.swagger_types = {
|
44
|
+
'api_format': 'str'
|
45
|
+
}
|
46
|
+
|
47
|
+
self.attribute_map = {
|
48
|
+
'api_format': 'apiFormat'
|
49
|
+
}
|
50
|
+
|
51
|
+
self._api_format = None
|
52
|
+
|
53
|
+
@staticmethod
|
54
|
+
def get_subtype(object_dictionary):
|
55
|
+
"""
|
56
|
+
Given the hash representation of a subtype of this class,
|
57
|
+
use the info in the hash to return the class of the subtype.
|
58
|
+
"""
|
59
|
+
type = object_dictionary['apiFormat']
|
60
|
+
|
61
|
+
if type == 'GENERIC':
|
62
|
+
return 'GenericChatResponse'
|
63
|
+
|
64
|
+
if type == 'COHERE':
|
65
|
+
return 'CohereChatResponse'
|
66
|
+
else:
|
67
|
+
return 'BaseChatResponse'
|
68
|
+
|
69
|
+
@property
|
70
|
+
def api_format(self):
|
71
|
+
"""
|
72
|
+
**[Required]** Gets the api_format of this BaseChatResponse.
|
73
|
+
The api format for the model's response
|
74
|
+
|
75
|
+
Allowed values for this property are: "COHERE", "GENERIC", 'UNKNOWN_ENUM_VALUE'.
|
76
|
+
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
|
77
|
+
|
78
|
+
|
79
|
+
:return: The api_format of this BaseChatResponse.
|
80
|
+
:rtype: str
|
81
|
+
"""
|
82
|
+
return self._api_format
|
83
|
+
|
84
|
+
@api_format.setter
|
85
|
+
def api_format(self, api_format):
|
86
|
+
"""
|
87
|
+
Sets the api_format of this BaseChatResponse.
|
88
|
+
The api format for the model's response
|
89
|
+
|
90
|
+
|
91
|
+
:param api_format: The api_format of this BaseChatResponse.
|
92
|
+
:type: str
|
93
|
+
"""
|
94
|
+
allowed_values = ["COHERE", "GENERIC"]
|
95
|
+
if not value_allowed_none_or_none_sentinel(api_format, allowed_values):
|
96
|
+
api_format = 'UNKNOWN_ENUM_VALUE'
|
97
|
+
self._api_format = api_format
|
98
|
+
|
99
|
+
def __repr__(self):
|
100
|
+
return formatted_flat_dict(self)
|
101
|
+
|
102
|
+
def __eq__(self, other):
|
103
|
+
if other is None:
|
104
|
+
return False
|
105
|
+
|
106
|
+
return self.__dict__ == other.__dict__
|
107
|
+
|
108
|
+
def __ne__(self, other):
|
109
|
+
return not self == other
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2024, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130
|
6
|
+
|
7
|
+
|
8
|
+
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
|
9
|
+
from oci.decorators import init_model_state_from_kwargs
|
10
|
+
|
11
|
+
|
12
|
+
@init_model_state_from_kwargs
|
13
|
+
class ChatChoice(object):
|
14
|
+
"""
|
15
|
+
Represents a single instance of the chat response.
|
16
|
+
"""
|
17
|
+
|
18
|
+
def __init__(self, **kwargs):
|
19
|
+
"""
|
20
|
+
Initializes a new ChatChoice object with values from keyword arguments.
|
21
|
+
The following keyword arguments are supported (corresponding to the getters/setters of this class):
|
22
|
+
|
23
|
+
:param index:
|
24
|
+
The value to assign to the index property of this ChatChoice.
|
25
|
+
:type index: int
|
26
|
+
|
27
|
+
:param message:
|
28
|
+
The value to assign to the message property of this ChatChoice.
|
29
|
+
:type message: oci.generative_ai_inference.models.Message
|
30
|
+
|
31
|
+
:param finish_reason:
|
32
|
+
The value to assign to the finish_reason property of this ChatChoice.
|
33
|
+
:type finish_reason: str
|
34
|
+
|
35
|
+
:param logprobs:
|
36
|
+
The value to assign to the logprobs property of this ChatChoice.
|
37
|
+
:type logprobs: oci.generative_ai_inference.models.Logprobs
|
38
|
+
|
39
|
+
"""
|
40
|
+
self.swagger_types = {
|
41
|
+
'index': 'int',
|
42
|
+
'message': 'Message',
|
43
|
+
'finish_reason': 'str',
|
44
|
+
'logprobs': 'Logprobs'
|
45
|
+
}
|
46
|
+
|
47
|
+
self.attribute_map = {
|
48
|
+
'index': 'index',
|
49
|
+
'message': 'message',
|
50
|
+
'finish_reason': 'finishReason',
|
51
|
+
'logprobs': 'logprobs'
|
52
|
+
}
|
53
|
+
|
54
|
+
self._index = None
|
55
|
+
self._message = None
|
56
|
+
self._finish_reason = None
|
57
|
+
self._logprobs = None
|
58
|
+
|
59
|
+
@property
|
60
|
+
def index(self):
|
61
|
+
"""
|
62
|
+
**[Required]** Gets the index of this ChatChoice.
|
63
|
+
The index of the chat.
|
64
|
+
|
65
|
+
|
66
|
+
:return: The index of this ChatChoice.
|
67
|
+
:rtype: int
|
68
|
+
"""
|
69
|
+
return self._index
|
70
|
+
|
71
|
+
@index.setter
|
72
|
+
def index(self, index):
|
73
|
+
"""
|
74
|
+
Sets the index of this ChatChoice.
|
75
|
+
The index of the chat.
|
76
|
+
|
77
|
+
|
78
|
+
:param index: The index of this ChatChoice.
|
79
|
+
:type: int
|
80
|
+
"""
|
81
|
+
self._index = index
|
82
|
+
|
83
|
+
@property
|
84
|
+
def message(self):
|
85
|
+
"""
|
86
|
+
**[Required]** Gets the message of this ChatChoice.
|
87
|
+
|
88
|
+
:return: The message of this ChatChoice.
|
89
|
+
:rtype: oci.generative_ai_inference.models.Message
|
90
|
+
"""
|
91
|
+
return self._message
|
92
|
+
|
93
|
+
@message.setter
|
94
|
+
def message(self, message):
|
95
|
+
"""
|
96
|
+
Sets the message of this ChatChoice.
|
97
|
+
|
98
|
+
:param message: The message of this ChatChoice.
|
99
|
+
:type: oci.generative_ai_inference.models.Message
|
100
|
+
"""
|
101
|
+
self._message = message
|
102
|
+
|
103
|
+
@property
|
104
|
+
def finish_reason(self):
|
105
|
+
"""
|
106
|
+
**[Required]** Gets the finish_reason of this ChatChoice.
|
107
|
+
The reason why the model stopped generating tokens.
|
108
|
+
|
109
|
+
Stops if the model hits a natural stop point or a provided stop sequence. Returns the length if the tokens reach the specified maximum number of tokens.
|
110
|
+
|
111
|
+
|
112
|
+
:return: The finish_reason of this ChatChoice.
|
113
|
+
:rtype: str
|
114
|
+
"""
|
115
|
+
return self._finish_reason
|
116
|
+
|
117
|
+
@finish_reason.setter
|
118
|
+
def finish_reason(self, finish_reason):
|
119
|
+
"""
|
120
|
+
Sets the finish_reason of this ChatChoice.
|
121
|
+
The reason why the model stopped generating tokens.
|
122
|
+
|
123
|
+
Stops if the model hits a natural stop point or a provided stop sequence. Returns the length if the tokens reach the specified maximum number of tokens.
|
124
|
+
|
125
|
+
|
126
|
+
:param finish_reason: The finish_reason of this ChatChoice.
|
127
|
+
:type: str
|
128
|
+
"""
|
129
|
+
self._finish_reason = finish_reason
|
130
|
+
|
131
|
+
@property
|
132
|
+
def logprobs(self):
|
133
|
+
"""
|
134
|
+
Gets the logprobs of this ChatChoice.
|
135
|
+
|
136
|
+
:return: The logprobs of this ChatChoice.
|
137
|
+
:rtype: oci.generative_ai_inference.models.Logprobs
|
138
|
+
"""
|
139
|
+
return self._logprobs
|
140
|
+
|
141
|
+
@logprobs.setter
|
142
|
+
def logprobs(self, logprobs):
|
143
|
+
"""
|
144
|
+
Sets the logprobs of this ChatChoice.
|
145
|
+
|
146
|
+
:param logprobs: The logprobs of this ChatChoice.
|
147
|
+
:type: oci.generative_ai_inference.models.Logprobs
|
148
|
+
"""
|
149
|
+
self._logprobs = logprobs
|
150
|
+
|
151
|
+
def __repr__(self):
|
152
|
+
return formatted_flat_dict(self)
|
153
|
+
|
154
|
+
def __eq__(self, other):
|
155
|
+
if other is None:
|
156
|
+
return False
|
157
|
+
|
158
|
+
return self.__dict__ == other.__dict__
|
159
|
+
|
160
|
+
def __ne__(self, other):
|
161
|
+
return not self == other
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2024, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130
|
6
|
+
|
7
|
+
|
8
|
+
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
|
9
|
+
from oci.decorators import init_model_state_from_kwargs
|
10
|
+
|
11
|
+
|
12
|
+
@init_model_state_from_kwargs
|
13
|
+
class ChatContent(object):
|
14
|
+
"""
|
15
|
+
The base class for the chat content.
|
16
|
+
"""
|
17
|
+
|
18
|
+
#: A constant which can be used with the type property of a ChatContent.
|
19
|
+
#: This constant has a value of "TEXT"
|
20
|
+
TYPE_TEXT = "TEXT"
|
21
|
+
|
22
|
+
def __init__(self, **kwargs):
|
23
|
+
"""
|
24
|
+
Initializes a new ChatContent object with values from keyword arguments. This class has the following subclasses and if you are using this class as input
|
25
|
+
to a service operations then you should favor using a subclass over the base class:
|
26
|
+
|
27
|
+
* :class:`~oci.generative_ai_inference.models.TextContent`
|
28
|
+
|
29
|
+
The following keyword arguments are supported (corresponding to the getters/setters of this class):
|
30
|
+
|
31
|
+
:param type:
|
32
|
+
The value to assign to the type property of this ChatContent.
|
33
|
+
Allowed values for this property are: "TEXT", 'UNKNOWN_ENUM_VALUE'.
|
34
|
+
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
|
35
|
+
:type type: str
|
36
|
+
|
37
|
+
"""
|
38
|
+
self.swagger_types = {
|
39
|
+
'type': 'str'
|
40
|
+
}
|
41
|
+
|
42
|
+
self.attribute_map = {
|
43
|
+
'type': 'type'
|
44
|
+
}
|
45
|
+
|
46
|
+
self._type = None
|
47
|
+
|
48
|
+
@staticmethod
|
49
|
+
def get_subtype(object_dictionary):
|
50
|
+
"""
|
51
|
+
Given the hash representation of a subtype of this class,
|
52
|
+
use the info in the hash to return the class of the subtype.
|
53
|
+
"""
|
54
|
+
type = object_dictionary['type']
|
55
|
+
|
56
|
+
if type == 'TEXT':
|
57
|
+
return 'TextContent'
|
58
|
+
else:
|
59
|
+
return 'ChatContent'
|
60
|
+
|
61
|
+
@property
|
62
|
+
def type(self):
|
63
|
+
"""
|
64
|
+
**[Required]** Gets the type of this ChatContent.
|
65
|
+
The type of the content.
|
66
|
+
|
67
|
+
Allowed values for this property are: "TEXT", 'UNKNOWN_ENUM_VALUE'.
|
68
|
+
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
|
69
|
+
|
70
|
+
|
71
|
+
:return: The type of this ChatContent.
|
72
|
+
:rtype: str
|
73
|
+
"""
|
74
|
+
return self._type
|
75
|
+
|
76
|
+
@type.setter
|
77
|
+
def type(self, type):
|
78
|
+
"""
|
79
|
+
Sets the type of this ChatContent.
|
80
|
+
The type of the content.
|
81
|
+
|
82
|
+
|
83
|
+
:param type: The type of this ChatContent.
|
84
|
+
:type: str
|
85
|
+
"""
|
86
|
+
allowed_values = ["TEXT"]
|
87
|
+
if not value_allowed_none_or_none_sentinel(type, allowed_values):
|
88
|
+
type = 'UNKNOWN_ENUM_VALUE'
|
89
|
+
self._type = type
|
90
|
+
|
91
|
+
def __repr__(self):
|
92
|
+
return formatted_flat_dict(self)
|
93
|
+
|
94
|
+
def __eq__(self, other):
|
95
|
+
if other is None:
|
96
|
+
return False
|
97
|
+
|
98
|
+
return self.__dict__ == other.__dict__
|
99
|
+
|
100
|
+
def __ne__(self, other):
|
101
|
+
return not self == other
|