google-apis-firebaseml_v2beta 0.1.0
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.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/firebaseml_v2beta/classes.rb +1331 -0
- data/lib/google/apis/firebaseml_v2beta/gem_version.rb +28 -0
- data/lib/google/apis/firebaseml_v2beta/representations.rb +595 -0
- data/lib/google/apis/firebaseml_v2beta/service.rb +165 -0
- data/lib/google/apis/firebaseml_v2beta.rb +36 -0
- data/lib/google-apis-firebaseml_v2beta.rb +15 -0
- metadata +82 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module FirebasemlV2beta
|
23
|
+
# Firebase ML API
|
24
|
+
#
|
25
|
+
# Access custom machine learning models hosted via Firebase ML.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/firebaseml_v2beta'
|
29
|
+
#
|
30
|
+
# Firebaseml = Google::Apis::FirebasemlV2beta # Alias the module
|
31
|
+
# service = Firebaseml::FirebaseMLService.new
|
32
|
+
#
|
33
|
+
# @see https://firebase.google.com
|
34
|
+
class FirebaseMLService < Google::Apis::Core::BaseService
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "https://firebaseml.$UNIVERSE_DOMAIN$/"
|
36
|
+
|
37
|
+
# @return [String]
|
38
|
+
# API key. Your API key identifies your project and provides you with API access,
|
39
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
40
|
+
attr_accessor :key
|
41
|
+
|
42
|
+
# @return [String]
|
43
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
44
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
45
|
+
attr_accessor :quota_user
|
46
|
+
|
47
|
+
def initialize
|
48
|
+
super(DEFAULT_ENDPOINT_TEMPLATE, '',
|
49
|
+
client_name: 'google-apis-firebaseml_v2beta',
|
50
|
+
client_version: Google::Apis::FirebasemlV2beta::GEM_VERSION)
|
51
|
+
@batch_path = 'batch'
|
52
|
+
end
|
53
|
+
|
54
|
+
# Perform a token counting.
|
55
|
+
# @param [String] endpoint
|
56
|
+
# Required. The name of the Endpoint requested to perform token counting. Format:
|
57
|
+
# `projects/`project`/locations/`location`/endpoints/`endpoint``
|
58
|
+
# @param [Google::Apis::FirebasemlV2beta::CountTokensRequest] count_tokens_request_object
|
59
|
+
# @param [String] fields
|
60
|
+
# Selector specifying which fields to include in a partial response.
|
61
|
+
# @param [String] quota_user
|
62
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
63
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
64
|
+
# @param [Google::Apis::RequestOptions] options
|
65
|
+
# Request-specific options
|
66
|
+
#
|
67
|
+
# @yield [result, err] Result & error if block supplied
|
68
|
+
# @yieldparam result [Google::Apis::FirebasemlV2beta::CountTokensResponse] parsed result object
|
69
|
+
# @yieldparam err [StandardError] error object if request failed
|
70
|
+
#
|
71
|
+
# @return [Google::Apis::FirebasemlV2beta::CountTokensResponse]
|
72
|
+
#
|
73
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
74
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
75
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
76
|
+
def count_model_tokens(endpoint, count_tokens_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
77
|
+
command = make_simple_command(:post, 'v2beta/{+endpoint}:countTokens', options)
|
78
|
+
command.request_representation = Google::Apis::FirebasemlV2beta::CountTokensRequest::Representation
|
79
|
+
command.request_object = count_tokens_request_object
|
80
|
+
command.response_representation = Google::Apis::FirebasemlV2beta::CountTokensResponse::Representation
|
81
|
+
command.response_class = Google::Apis::FirebasemlV2beta::CountTokensResponse
|
82
|
+
command.params['endpoint'] = endpoint unless endpoint.nil?
|
83
|
+
command.query['fields'] = fields unless fields.nil?
|
84
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
85
|
+
execute_or_queue_command(command, &block)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Generate content with multimodal inputs.
|
89
|
+
# @param [String] model
|
90
|
+
# Required. The name of the publisher model requested to serve the prediction.
|
91
|
+
# Format: `projects/`project`/locations/`location`/publishers/*/models/*`
|
92
|
+
# @param [Google::Apis::FirebasemlV2beta::GenerateContentRequest] generate_content_request_object
|
93
|
+
# @param [String] fields
|
94
|
+
# Selector specifying which fields to include in a partial response.
|
95
|
+
# @param [String] quota_user
|
96
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
97
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
98
|
+
# @param [Google::Apis::RequestOptions] options
|
99
|
+
# Request-specific options
|
100
|
+
#
|
101
|
+
# @yield [result, err] Result & error if block supplied
|
102
|
+
# @yieldparam result [Google::Apis::FirebasemlV2beta::GenerateContentResponse] parsed result object
|
103
|
+
# @yieldparam err [StandardError] error object if request failed
|
104
|
+
#
|
105
|
+
# @return [Google::Apis::FirebasemlV2beta::GenerateContentResponse]
|
106
|
+
#
|
107
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
108
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
109
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
110
|
+
def generate_model_content(model, generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
111
|
+
command = make_simple_command(:post, 'v2beta/{+model}:generateContent', options)
|
112
|
+
command.request_representation = Google::Apis::FirebasemlV2beta::GenerateContentRequest::Representation
|
113
|
+
command.request_object = generate_content_request_object
|
114
|
+
command.response_representation = Google::Apis::FirebasemlV2beta::GenerateContentResponse::Representation
|
115
|
+
command.response_class = Google::Apis::FirebasemlV2beta::GenerateContentResponse
|
116
|
+
command.params['model'] = model unless model.nil?
|
117
|
+
command.query['fields'] = fields unless fields.nil?
|
118
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
119
|
+
execute_or_queue_command(command, &block)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Generate content with multimodal inputs with streaming support.
|
123
|
+
# @param [String] model
|
124
|
+
# Required. The name of the publisher model requested to serve the prediction.
|
125
|
+
# Format: `projects/`project`/locations/`location`/publishers/*/models/*`
|
126
|
+
# @param [Google::Apis::FirebasemlV2beta::GenerateContentRequest] generate_content_request_object
|
127
|
+
# @param [String] fields
|
128
|
+
# Selector specifying which fields to include in a partial response.
|
129
|
+
# @param [String] quota_user
|
130
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
131
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
132
|
+
# @param [Google::Apis::RequestOptions] options
|
133
|
+
# Request-specific options
|
134
|
+
#
|
135
|
+
# @yield [result, err] Result & error if block supplied
|
136
|
+
# @yieldparam result [Google::Apis::FirebasemlV2beta::GenerateContentResponse] parsed result object
|
137
|
+
# @yieldparam err [StandardError] error object if request failed
|
138
|
+
#
|
139
|
+
# @return [Google::Apis::FirebasemlV2beta::GenerateContentResponse]
|
140
|
+
#
|
141
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
142
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
143
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
144
|
+
def stream_project_location_publisher_model_generate_content(model, generate_content_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
145
|
+
command = make_simple_command(:post, 'v2beta/{+model}:streamGenerateContent', options)
|
146
|
+
command.request_representation = Google::Apis::FirebasemlV2beta::GenerateContentRequest::Representation
|
147
|
+
command.request_object = generate_content_request_object
|
148
|
+
command.response_representation = Google::Apis::FirebasemlV2beta::GenerateContentResponse::Representation
|
149
|
+
command.response_class = Google::Apis::FirebasemlV2beta::GenerateContentResponse
|
150
|
+
command.params['model'] = model unless model.nil?
|
151
|
+
command.query['fields'] = fields unless fields.nil?
|
152
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
153
|
+
execute_or_queue_command(command, &block)
|
154
|
+
end
|
155
|
+
|
156
|
+
protected
|
157
|
+
|
158
|
+
def apply_command_defaults(command)
|
159
|
+
command.query['key'] = key unless key.nil?
|
160
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/firebaseml_v2beta/service.rb'
|
16
|
+
require 'google/apis/firebaseml_v2beta/classes.rb'
|
17
|
+
require 'google/apis/firebaseml_v2beta/representations.rb'
|
18
|
+
require 'google/apis/firebaseml_v2beta/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# Firebase ML API
|
23
|
+
#
|
24
|
+
# Access custom machine learning models hosted via Firebase ML.
|
25
|
+
#
|
26
|
+
# @see https://firebase.google.com
|
27
|
+
module FirebasemlV2beta
|
28
|
+
# Version of the Firebase ML API this client connects to.
|
29
|
+
# This is NOT the gem version.
|
30
|
+
VERSION = 'V2beta'
|
31
|
+
|
32
|
+
# See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
33
|
+
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "google/apis/firebaseml_v2beta"
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-apis-firebaseml_v2beta
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Google LLC
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: google-apis-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.14.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.a
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.14.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.a
|
33
|
+
description: This is the simple REST client for Firebase ML API V2beta. Simple REST
|
34
|
+
clients are Ruby client libraries that provide access to Google services via their
|
35
|
+
HTTP REST API endpoints. These libraries are generated and updated automatically
|
36
|
+
based on the discovery documents published by the service, and they handle most
|
37
|
+
concerns such as authentication, pagination, retry, timeouts, and logging. You can
|
38
|
+
use this client to access the Firebase ML API, but note that some services may provide
|
39
|
+
a separate modern client that is easier to use.
|
40
|
+
email: googleapis-packages@google.com
|
41
|
+
executables: []
|
42
|
+
extensions: []
|
43
|
+
extra_rdoc_files: []
|
44
|
+
files:
|
45
|
+
- ".yardopts"
|
46
|
+
- CHANGELOG.md
|
47
|
+
- LICENSE.md
|
48
|
+
- OVERVIEW.md
|
49
|
+
- lib/google-apis-firebaseml_v2beta.rb
|
50
|
+
- lib/google/apis/firebaseml_v2beta.rb
|
51
|
+
- lib/google/apis/firebaseml_v2beta/classes.rb
|
52
|
+
- lib/google/apis/firebaseml_v2beta/gem_version.rb
|
53
|
+
- lib/google/apis/firebaseml_v2beta/representations.rb
|
54
|
+
- lib/google/apis/firebaseml_v2beta/service.rb
|
55
|
+
homepage: https://github.com/google/google-api-ruby-client
|
56
|
+
licenses:
|
57
|
+
- Apache-2.0
|
58
|
+
metadata:
|
59
|
+
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
60
|
+
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-firebaseml_v2beta/CHANGELOG.md
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-firebaseml_v2beta/v0.1.0
|
62
|
+
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-firebaseml_v2beta
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '2.7'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubygems_version: 3.5.6
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Simple REST client for Firebase ML API V2beta
|
82
|
+
test_files: []
|