Class: Google::Apis::FirebasemlV2beta::FirebaseMLService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::FirebasemlV2beta::FirebaseMLService
- Defined in:
- lib/google/apis/firebaseml_v2beta/service.rb
Overview
Firebase ML API
Access custom machine learning models hosted via Firebase ML.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://firebaseml.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#count_model_tokens(endpoint, google_cloud_aiplatform_v1beta1_count_tokens_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1CountTokensResponse
Perform a token counting.
-
#generate_model_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse
Generate content with multimodal inputs.
-
#initialize ⇒ FirebaseMLService
constructor
A new instance of FirebaseMLService.
-
#stream_project_location_publisher_model_generate_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse
Generate content with multimodal inputs with streaming support.
Constructor Details
#initialize ⇒ FirebaseMLService
Returns a new instance of FirebaseMLService.
47 48 49 50 51 52 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-firebaseml_v2beta', client_version: Google::Apis::FirebasemlV2beta::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#count_model_tokens(endpoint, google_cloud_aiplatform_v1beta1_count_tokens_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1CountTokensResponse
Perform a token counting.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 76 def count_model_tokens(endpoint, google_cloud_aiplatform_v1beta1_count_tokens_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2beta/{+endpoint}:countTokens', ) command.request_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1CountTokensRequest::Representation command.request_object = google_cloud_aiplatform_v1beta1_count_tokens_request_object command.response_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1CountTokensResponse::Representation command.response_class = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1CountTokensResponse command.params['endpoint'] = endpoint unless endpoint.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#generate_model_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse
Generate content with multimodal inputs.
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 110 def generate_model_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2beta/{+model}:generateContent', ) command.request_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentRequest::Representation command.request_object = google_cloud_aiplatform_v1beta1_generate_content_request_object command.response_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse::Representation command.response_class = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse command.params['model'] = model unless model.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#stream_project_location_publisher_model_generate_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse
Generate content with multimodal inputs with streaming support.
144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/google/apis/firebaseml_v2beta/service.rb', line 144 def stream_project_location_publisher_model_generate_content(model, google_cloud_aiplatform_v1beta1_generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2beta/{+model}:streamGenerateContent', ) command.request_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentRequest::Representation command.request_object = google_cloud_aiplatform_v1beta1_generate_content_request_object command.response_representation = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse::Representation command.response_class = Google::Apis::FirebasemlV2beta::GoogleCloudAiplatformV1beta1GenerateContentResponse command.params['model'] = model unless model.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |