tensors-ruby 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/Gemfile +9 -0
- data/README.md +154 -0
- data/lib/tensors-ruby/api/auth_api.rb +387 -0
- data/lib/tensors-ruby/api/civit_ai_api.rb +85 -0
- data/lib/tensors-ruby/api/comfy_uiapi_api.rb +582 -0
- data/lib/tensors-ruby/api/database_api.rb +655 -0
- data/lib/tensors-ruby/api/default_api.rb +77 -0
- data/lib/tensors-ruby/api/download_api.rb +210 -0
- data/lib/tensors-ruby/api/gallery_api.rb +416 -0
- data/lib/tensors-ruby/api/search_api.rb +129 -0
- data/lib/tensors-ruby/api_client.rb +441 -0
- data/lib/tensors-ruby/api_error.rb +58 -0
- data/lib/tensors-ruby/api_model_base.rb +88 -0
- data/lib/tensors-ruby/configuration.rb +399 -0
- data/lib/tensors-ruby/models/cache_request.rb +165 -0
- data/lib/tensors-ruby/models/download_request.rb +179 -0
- data/lib/tensors-ruby/models/generate_request.rb +444 -0
- data/lib/tensors-ruby/models/generate_response.rb +213 -0
- data/lib/tensors-ruby/models/http_validation_error.rb +149 -0
- data/lib/tensors-ruby/models/location_inner.rb +103 -0
- data/lib/tensors-ruby/models/metadata_update.rb +181 -0
- data/lib/tensors-ruby/models/models_response.rb +205 -0
- data/lib/tensors-ruby/models/provider.rb +41 -0
- data/lib/tensors-ruby/models/queue_status_response.rb +161 -0
- data/lib/tensors-ruby/models/scan_request.rb +165 -0
- data/lib/tensors-ruby/models/sort_order.rb +41 -0
- data/lib/tensors-ruby/models/system_stats_response.rb +161 -0
- data/lib/tensors-ruby/models/validation_error.rb +237 -0
- data/lib/tensors-ruby/models/workflow_request.rb +168 -0
- data/lib/tensors-ruby/models/workflow_response.rb +222 -0
- data/lib/tensors-ruby/version.rb +15 -0
- data/lib/tensors-ruby.rb +64 -0
- data/spec/api/auth_api_spec.rb +109 -0
- data/spec/api/civit_ai_api_spec.rb +47 -0
- data/spec/api/comfy_uiapi_api_spec.rb +141 -0
- data/spec/api/database_api_spec.rb +155 -0
- data/spec/api/default_api_spec.rb +45 -0
- data/spec/api/download_api_spec.rb +70 -0
- data/spec/api/gallery_api_spec.rb +109 -0
- data/spec/api/search_api_spec.rb +60 -0
- data/spec/models/cache_request_spec.rb +36 -0
- data/spec/models/download_request_spec.rb +54 -0
- data/spec/models/generate_request_spec.rb +108 -0
- data/spec/models/generate_response_spec.rb +54 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/location_inner_spec.rb +21 -0
- data/spec/models/metadata_update_spec.rb +54 -0
- data/spec/models/models_response_spec.rb +66 -0
- data/spec/models/provider_spec.rb +30 -0
- data/spec/models/queue_status_response_spec.rb +42 -0
- data/spec/models/scan_request_spec.rb +36 -0
- data/spec/models/sort_order_spec.rb +30 -0
- data/spec/models/system_stats_response_spec.rb +42 -0
- data/spec/models/validation_error_spec.rb +60 -0
- data/spec/models/workflow_request_spec.rb +36 -0
- data/spec/models/workflow_response_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- data/tensors-ruby.gemspec +41 -0
- metadata +194 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#tensors
|
|
3
|
+
|
|
4
|
+
#API for CivitAI model management and image gallery
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.18
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module TensorsApi
|
|
16
|
+
class DefaultApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Status
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [Hash<String, String>]
|
|
25
|
+
def status_status_get(opts = {})
|
|
26
|
+
data, _status_code, _headers = status_status_get_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Status
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(Hash<String, String>, Integer, Hash)>] Hash<String, String> data, response status code and response headers
|
|
33
|
+
def status_status_get_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.status_status_get ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/status'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'Hash<String, String>'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || []
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"DefaultApi.status_status_get",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: DefaultApi#status_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#tensors
|
|
3
|
+
|
|
4
|
+
#API for CivitAI model management and image gallery
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.18
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module TensorsApi
|
|
16
|
+
class DownloadApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get Download Status
|
|
23
|
+
# Get status of a download.
|
|
24
|
+
# @param download_id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Hash<String, Object>]
|
|
27
|
+
def get_download_status_api_download_status_download_id_get(download_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_download_status_api_download_status_download_id_get_with_http_info(download_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get Download Status
|
|
33
|
+
# Get status of a download.
|
|
34
|
+
# @param download_id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
37
|
+
def get_download_status_api_download_status_download_id_get_with_http_info(download_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: DownloadApi.get_download_status_api_download_status_download_id_get ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'download_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && download_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'download_id' when calling DownloadApi.get_download_status_api_download_status_download_id_get"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/download/status/{download_id}'.sub('{' + 'download_id' + '}', CGI.escape(download_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"DownloadApi.get_download_status_api_download_status_download_id_get",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: DownloadApi#get_download_status_api_download_status_download_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List Active Downloads
|
|
86
|
+
# List all active/recent downloads.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [Hash<String, Object>]
|
|
89
|
+
def list_active_downloads_api_download_active_get(opts = {})
|
|
90
|
+
data, _status_code, _headers = list_active_downloads_api_download_active_get_with_http_info(opts)
|
|
91
|
+
data
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# List Active Downloads
|
|
95
|
+
# List all active/recent downloads.
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
98
|
+
def list_active_downloads_api_download_active_get_with_http_info(opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: DownloadApi.list_active_downloads_api_download_active_get ...'
|
|
101
|
+
end
|
|
102
|
+
# resource path
|
|
103
|
+
local_var_path = '/api/download/active'
|
|
104
|
+
|
|
105
|
+
# query parameters
|
|
106
|
+
query_params = opts[:query_params] || {}
|
|
107
|
+
|
|
108
|
+
# header parameters
|
|
109
|
+
header_params = opts[:header_params] || {}
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = opts[:form_params] || {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = opts[:debug_body]
|
|
118
|
+
|
|
119
|
+
# return_type
|
|
120
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
121
|
+
|
|
122
|
+
# auth_names
|
|
123
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
|
|
124
|
+
|
|
125
|
+
new_options = opts.merge(
|
|
126
|
+
:operation => :"DownloadApi.list_active_downloads_api_download_active_get",
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => return_type
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
136
|
+
if @api_client.config.debugging
|
|
137
|
+
@api_client.config.logger.debug "API called: DownloadApi#list_active_downloads_api_download_active_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
138
|
+
end
|
|
139
|
+
return data, status_code, headers
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Start Download
|
|
143
|
+
# Start a model download (async with progress tracking).
|
|
144
|
+
# @param download_request [DownloadRequest]
|
|
145
|
+
# @param [Hash] opts the optional parameters
|
|
146
|
+
# @return [Hash<String, Object>]
|
|
147
|
+
def start_download_api_download_post(download_request, opts = {})
|
|
148
|
+
data, _status_code, _headers = start_download_api_download_post_with_http_info(download_request, opts)
|
|
149
|
+
data
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Start Download
|
|
153
|
+
# Start a model download (async with progress tracking).
|
|
154
|
+
# @param download_request [DownloadRequest]
|
|
155
|
+
# @param [Hash] opts the optional parameters
|
|
156
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
157
|
+
def start_download_api_download_post_with_http_info(download_request, opts = {})
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug 'Calling API: DownloadApi.start_download_api_download_post ...'
|
|
160
|
+
end
|
|
161
|
+
# verify the required parameter 'download_request' is set
|
|
162
|
+
if @api_client.config.client_side_validation && download_request.nil?
|
|
163
|
+
fail ArgumentError, "Missing the required parameter 'download_request' when calling DownloadApi.start_download_api_download_post"
|
|
164
|
+
end
|
|
165
|
+
# resource path
|
|
166
|
+
local_var_path = '/api/download'
|
|
167
|
+
|
|
168
|
+
# query parameters
|
|
169
|
+
query_params = opts[:query_params] || {}
|
|
170
|
+
|
|
171
|
+
# header parameters
|
|
172
|
+
header_params = opts[:header_params] || {}
|
|
173
|
+
# HTTP header 'Accept' (if needed)
|
|
174
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
175
|
+
# HTTP header 'Content-Type'
|
|
176
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
177
|
+
if !content_type.nil?
|
|
178
|
+
header_params['Content-Type'] = content_type
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# form parameters
|
|
182
|
+
form_params = opts[:form_params] || {}
|
|
183
|
+
|
|
184
|
+
# http body (model)
|
|
185
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(download_request)
|
|
186
|
+
|
|
187
|
+
# return_type
|
|
188
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
189
|
+
|
|
190
|
+
# auth_names
|
|
191
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
|
|
192
|
+
|
|
193
|
+
new_options = opts.merge(
|
|
194
|
+
:operation => :"DownloadApi.start_download_api_download_post",
|
|
195
|
+
:header_params => header_params,
|
|
196
|
+
:query_params => query_params,
|
|
197
|
+
:form_params => form_params,
|
|
198
|
+
:body => post_body,
|
|
199
|
+
:auth_names => auth_names,
|
|
200
|
+
:return_type => return_type
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
204
|
+
if @api_client.config.debugging
|
|
205
|
+
@api_client.config.logger.debug "API called: DownloadApi#start_download_api_download_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
206
|
+
end
|
|
207
|
+
return data, status_code, headers
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|