abliteration 0.1.5 → 0.1.7

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/docs/DeletionSummary.md +28 -0
  4. data/docs/DeletionSummaryTimelineInner.md +20 -0
  5. data/docs/DeletionSummaryTopByDownloadsInner.md +24 -0
  6. data/docs/DelistedModel.md +30 -0
  7. data/docs/GetHistoricalDeletionSummary200Response.md +32 -0
  8. data/docs/HistoricalDeletion.md +28 -0
  9. data/docs/ListDelistedModels200Response.md +32 -0
  10. data/docs/ListHistoricalDeletions200Response.md +32 -0
  11. data/docs/ModelDetail.md +4 -0
  12. data/docs/ModelSummary.md +5 -1
  13. data/docs/ModelsApi.md +229 -2
  14. data/lib/abliteration/api/models_api.rb +245 -4
  15. data/lib/abliteration/models/deletion_summary.rb +202 -0
  16. data/lib/abliteration/models/deletion_summary_timeline_inner.rb +156 -0
  17. data/lib/abliteration/models/deletion_summary_top_by_downloads_inner.rb +174 -0
  18. data/lib/abliteration/models/delisted_model.rb +206 -0
  19. data/lib/abliteration/models/get_historical_deletion_summary200_response.rb +384 -0
  20. data/lib/abliteration/models/historical_deletion.rb +197 -0
  21. data/lib/abliteration/models/list_delisted_models200_response.rb +386 -0
  22. data/lib/abliteration/models/list_historical_deletions200_response.rb +386 -0
  23. data/lib/abliteration/models/model_detail.rb +23 -1
  24. data/lib/abliteration/models/model_summary.rb +27 -5
  25. data/lib/abliteration/version.rb +1 -1
  26. data/lib/abliteration.rb +8 -0
  27. data/spec/models/deletion_summary_spec.rb +66 -0
  28. data/spec/models/deletion_summary_timeline_inner_spec.rb +42 -0
  29. data/spec/models/deletion_summary_top_by_downloads_inner_spec.rb +54 -0
  30. data/spec/models/delisted_model_spec.rb +72 -0
  31. data/spec/models/get_historical_deletion_summary200_response_spec.rb +82 -0
  32. data/spec/models/historical_deletion_spec.rb +66 -0
  33. data/spec/models/list_delisted_models200_response_spec.rb +82 -0
  34. data/spec/models/list_historical_deletions200_response_spec.rb +82 -0
  35. metadata +34 -2
@@ -19,8 +19,65 @@ module Abliteration
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Historical deletions — aggregate summary
23
+ # Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [GetHistoricalDeletionSummary200Response]
26
+ def get_historical_deletion_summary(opts = {})
27
+ data, _status_code, _headers = get_historical_deletion_summary_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Historical deletions — aggregate summary
32
+ # Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(GetHistoricalDeletionSummary200Response, Integer, Hash)>] GetHistoricalDeletionSummary200Response data, response status code and response headers
35
+ def get_historical_deletion_summary_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ModelsApi.get_historical_deletion_summary ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/api/v1/models/historical-deletions/summary'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'GetHistoricalDeletionSummary200Response'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"ModelsApi.get_historical_deletion_summary",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: ModelsApi#get_historical_deletion_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
22
79
  # Get one model
23
- # Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
80
+ # Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries `is_delisted=1` and `days_since_gone`.
24
81
  # @param id [String]
25
82
  # @param [Hash] opts the optional parameters
26
83
  # @return [GetModel200Response]
@@ -30,7 +87,7 @@ module Abliteration
30
87
  end
31
88
 
32
89
  # Get one model
33
- # Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
90
+ # Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries &#x60;is_delisted&#x3D;1&#x60; and &#x60;days_since_gone&#x60;.
34
91
  # @param id [String]
35
92
  # @param [Hash] opts the optional parameters
36
93
  # @return [Array<(GetModel200Response, Integer, Hash)>] GetModel200Response data, response status code and response headers
@@ -82,8 +139,185 @@ module Abliteration
82
139
  return data, status_code, headers
83
140
  end
84
141
 
142
+ # List delisted models (change stream)
143
+ # Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with `since=<last_seen_at of your previous run>` to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \"wayback\" tools live on this endpoint. See /api#change-stream.
144
+ # @param [Hash] opts the optional parameters
145
+ # @option opts [String] :since ISO-8601 date or timestamp. Rows with last_seen_at &gt;&#x3D; since only. Use your previous poll&#39;s newest last_seen_at to build an incremental feed.
146
+ # @option opts [String] :sort &#x60;recent&#x60; (default, newest disappearance first) or &#x60;downloads&#x60; (biggest casualties first — best for post-mortem coverage). (default to 'recent')
147
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
148
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
149
+ # @return [ListDelistedModels200Response]
150
+ def list_delisted_models(opts = {})
151
+ data, _status_code, _headers = list_delisted_models_with_http_info(opts)
152
+ data
153
+ end
154
+
155
+ # List delisted models (change stream)
156
+ # Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with &#x60;since&#x3D;&lt;last_seen_at of your previous run&gt;&#x60; to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \&quot;wayback\&quot; tools live on this endpoint. See /api#change-stream.
157
+ # @param [Hash] opts the optional parameters
158
+ # @option opts [String] :since ISO-8601 date or timestamp. Rows with last_seen_at &gt;&#x3D; since only. Use your previous poll&#39;s newest last_seen_at to build an incremental feed.
159
+ # @option opts [String] :sort &#x60;recent&#x60; (default, newest disappearance first) or &#x60;downloads&#x60; (biggest casualties first — best for post-mortem coverage). (default to 'recent')
160
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
161
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
162
+ # @return [Array<(ListDelistedModels200Response, Integer, Hash)>] ListDelistedModels200Response data, response status code and response headers
163
+ def list_delisted_models_with_http_info(opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: ModelsApi.list_delisted_models ...'
166
+ end
167
+ allowable_values = ["recent", "downloads"]
168
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
169
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
170
+ end
171
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
172
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_delisted_models, must be smaller than or equal to 1000.'
173
+ end
174
+
175
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
176
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_delisted_models, must be greater than or equal to 1.'
177
+ end
178
+
179
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
180
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_delisted_models, must be greater than or equal to 0.'
181
+ end
182
+
183
+ # resource path
184
+ local_var_path = '/api/v1/models/delisted'
185
+
186
+ # query parameters
187
+ query_params = opts[:query_params] || {}
188
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
189
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
190
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
191
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:debug_body]
203
+
204
+ # return_type
205
+ return_type = opts[:debug_return_type] || 'ListDelistedModels200Response'
206
+
207
+ # auth_names
208
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
209
+
210
+ new_options = opts.merge(
211
+ :operation => :"ModelsApi.list_delisted_models",
212
+ :header_params => header_params,
213
+ :query_params => query_params,
214
+ :form_params => form_params,
215
+ :body => post_body,
216
+ :auth_names => auth_names,
217
+ :return_type => return_type
218
+ )
219
+
220
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: ModelsApi#list_delisted_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+
227
+ # Historical deletions — paged list
228
+ # Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
231
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
232
+ # @option opts [String] :sort &#x60;downloads&#x60; (default, biggest first), &#x60;recent&#x60; (newest last_seen_month first), &#x60;lifespan&#x60; (longest-lived first). (default to 'downloads')
233
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
234
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
235
+ # @return [ListHistoricalDeletions200Response]
236
+ def list_historical_deletions(opts = {})
237
+ data, _status_code, _headers = list_historical_deletions_with_http_info(opts)
238
+ data
239
+ end
240
+
241
+ # Historical deletions — paged list
242
+ # Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (&#x60;downloads&#x60;, default), recency (&#x60;recent&#x60;, newest deaths first) or lifespan (&#x60;lifespan&#x60;, longest-lived first — surprising deaths).
243
+ # @param [Hash] opts the optional parameters
244
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
245
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
246
+ # @option opts [String] :sort &#x60;downloads&#x60; (default, biggest first), &#x60;recent&#x60; (newest last_seen_month first), &#x60;lifespan&#x60; (longest-lived first). (default to 'downloads')
247
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
248
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
249
+ # @return [Array<(ListHistoricalDeletions200Response, Integer, Hash)>] ListHistoricalDeletions200Response data, response status code and response headers
250
+ def list_historical_deletions_with_http_info(opts = {})
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug 'Calling API: ModelsApi.list_historical_deletions ...'
253
+ end
254
+ if @api_client.config.client_side_validation && !opts[:'min_peak_downloads'].nil? && opts[:'min_peak_downloads'] < 0
255
+ fail ArgumentError, 'invalid value for "opts[:"min_peak_downloads"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
256
+ end
257
+
258
+ allowable_values = ["downloads", "recent", "lifespan"]
259
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
260
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
261
+ end
262
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
263
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be smaller than or equal to 1000.'
264
+ end
265
+
266
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
267
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 1.'
268
+ end
269
+
270
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
271
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
272
+ end
273
+
274
+ # resource path
275
+ local_var_path = '/api/v1/models/historical-deletions/list'
276
+
277
+ # query parameters
278
+ query_params = opts[:query_params] || {}
279
+ query_params[:'since_month'] = opts[:'since_month'] if !opts[:'since_month'].nil?
280
+ query_params[:'min_peak_downloads'] = opts[:'min_peak_downloads'] if !opts[:'min_peak_downloads'].nil?
281
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
282
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
283
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
284
+
285
+ # header parameters
286
+ header_params = opts[:header_params] || {}
287
+ # HTTP header 'Accept' (if needed)
288
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
289
+
290
+ # form parameters
291
+ form_params = opts[:form_params] || {}
292
+
293
+ # http body (model)
294
+ post_body = opts[:debug_body]
295
+
296
+ # return_type
297
+ return_type = opts[:debug_return_type] || 'ListHistoricalDeletions200Response'
298
+
299
+ # auth_names
300
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
301
+
302
+ new_options = opts.merge(
303
+ :operation => :"ModelsApi.list_historical_deletions",
304
+ :header_params => header_params,
305
+ :query_params => query_params,
306
+ :form_params => form_params,
307
+ :body => post_body,
308
+ :auth_names => auth_names,
309
+ :return_type => return_type
310
+ )
311
+
312
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug "API called: ModelsApi#list_historical_deletions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
315
+ end
316
+ return data, status_code, headers
317
+ end
318
+
85
319
  # List models
86
- # Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded here but remain reachable by id.
320
+ # Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (`delisted=live`); pass `delisted=dead|all` to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
87
321
  # @param [Hash] opts the optional parameters
88
322
  # @option opts [String] :method M-code, case-insensitive. See GET /api/v1/methods.
89
323
  # @option opts [String] :family Base family, for example qwen or llama.
@@ -93,6 +327,7 @@ module Abliteration
93
327
  # @option opts [Integer] :downloads_lte
94
328
  # @option opts [String] :created_after ISO-8601 date or timestamp, inclusive.
95
329
  # @option opts [String] :created_before ISO-8601 date or timestamp, inclusive.
330
+ # @option opts [String] :delisted Tombstone filter. &#x60;live&#x60; (default): HF-visible models only. &#x60;dead&#x60;: delisted-only (same shape as this endpoint plus is_delisted&#x3D;1 and last_seen_at). &#x60;all&#x60;: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted. (default to 'live')
96
331
  # @option opts [String] :sort Bare key is the natural direction (downloads/likes &#x3D; most first, dates &#x3D; newest first). A leading &#x60;-&#x60; flips it. &#x60;created&#x60; and &#x60;first_seen&#x60; are aliases for the full column names. (default to 'downloads')
97
332
  # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
98
333
  # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
@@ -103,7 +338,7 @@ module Abliteration
103
338
  end
104
339
 
105
340
  # List models
106
- # Cost: 5-300+ credits, stepped by returned rows and multiplied by &#x60;1 + (offset/2500)²&#x60;. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset&#x3D;10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded here but remain reachable by id.
341
+ # Cost: 5-300+ credits, stepped by returned rows and multiplied by &#x60;1 + (offset/2500)²&#x60;. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset&#x3D;10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (&#x60;delisted&#x3D;live&#x60;); pass &#x60;delisted&#x3D;dead|all&#x60; to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
107
342
  # @param [Hash] opts the optional parameters
108
343
  # @option opts [String] :method M-code, case-insensitive. See GET /api/v1/methods.
109
344
  # @option opts [String] :family Base family, for example qwen or llama.
@@ -113,6 +348,7 @@ module Abliteration
113
348
  # @option opts [Integer] :downloads_lte
114
349
  # @option opts [String] :created_after ISO-8601 date or timestamp, inclusive.
115
350
  # @option opts [String] :created_before ISO-8601 date or timestamp, inclusive.
351
+ # @option opts [String] :delisted Tombstone filter. &#x60;live&#x60; (default): HF-visible models only. &#x60;dead&#x60;: delisted-only (same shape as this endpoint plus is_delisted&#x3D;1 and last_seen_at). &#x60;all&#x60;: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted. (default to 'live')
116
352
  # @option opts [String] :sort Bare key is the natural direction (downloads/likes &#x3D; most first, dates &#x3D; newest first). A leading &#x60;-&#x60; flips it. &#x60;created&#x60; and &#x60;first_seen&#x60; are aliases for the full column names. (default to 'downloads')
117
353
  # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
118
354
  # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
@@ -121,6 +357,10 @@ module Abliteration
121
357
  if @api_client.config.debugging
122
358
  @api_client.config.logger.debug 'Calling API: ModelsApi.list_models ...'
123
359
  end
360
+ allowable_values = ["live", "dead", "all"]
361
+ if @api_client.config.client_side_validation && opts[:'delisted'] && !allowable_values.include?(opts[:'delisted'])
362
+ fail ArgumentError, "invalid value for \"delisted\", must be one of #{allowable_values}"
363
+ end
124
364
  allowable_values = ["downloads", "-downloads", "likes", "-likes", "created", "-created", "created_at", "-created_at", "first_seen", "-first_seen", "first_seen_at", "-first_seen_at"]
125
365
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
126
366
  fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
@@ -150,6 +390,7 @@ module Abliteration
150
390
  query_params[:'downloads_lte'] = opts[:'downloads_lte'] if !opts[:'downloads_lte'].nil?
151
391
  query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
152
392
  query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
393
+ query_params[:'delisted'] = opts[:'delisted'] if !opts[:'delisted'].nil?
153
394
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
154
395
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
155
396
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ # Aggregate rollup of the 24-month HF deletion analysis.
18
+ class DeletionSummary < ApiModelBase
19
+ # Live catalog size plus historical deletions.
20
+ attr_accessor :total_ever_seen
21
+
22
+ attr_accessor :total_deleted
23
+
24
+ # Percentage of ever-seen models that are now gone.
25
+ attr_accessor :deletion_rate_pct
26
+
27
+ # Average lifespan of deleted models, in months.
28
+ attr_accessor :avg_months_alive
29
+
30
+ # Deletions grouped by last_seen_month, ascending.
31
+ attr_accessor :timeline
32
+
33
+ # Top-10 biggest casualties by peak downloads.
34
+ attr_accessor :top_by_downloads
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'total_ever_seen' => :'total_ever_seen',
40
+ :'total_deleted' => :'total_deleted',
41
+ :'deletion_rate_pct' => :'deletion_rate_pct',
42
+ :'avg_months_alive' => :'avg_months_alive',
43
+ :'timeline' => :'timeline',
44
+ :'top_by_downloads' => :'top_by_downloads'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'total_ever_seen' => :'Integer',
62
+ :'total_deleted' => :'Integer',
63
+ :'deletion_rate_pct' => :'Float',
64
+ :'avg_months_alive' => :'Float',
65
+ :'timeline' => :'Array<DeletionSummaryTimelineInner>',
66
+ :'top_by_downloads' => :'Array<DeletionSummaryTopByDownloadsInner>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DeletionSummary` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DeletionSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'total_ever_seen')
93
+ self.total_ever_seen = attributes[:'total_ever_seen']
94
+ end
95
+
96
+ if attributes.key?(:'total_deleted')
97
+ self.total_deleted = attributes[:'total_deleted']
98
+ end
99
+
100
+ if attributes.key?(:'deletion_rate_pct')
101
+ self.deletion_rate_pct = attributes[:'deletion_rate_pct']
102
+ end
103
+
104
+ if attributes.key?(:'avg_months_alive')
105
+ self.avg_months_alive = attributes[:'avg_months_alive']
106
+ end
107
+
108
+ if attributes.key?(:'timeline')
109
+ if (value = attributes[:'timeline']).is_a?(Array)
110
+ self.timeline = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'top_by_downloads')
115
+ if (value = attributes[:'top_by_downloads']).is_a?(Array)
116
+ self.top_by_downloads = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ total_ever_seen == o.total_ever_seen &&
142
+ total_deleted == o.total_deleted &&
143
+ deletion_rate_pct == o.deletion_rate_pct &&
144
+ avg_months_alive == o.avg_months_alive &&
145
+ timeline == o.timeline &&
146
+ top_by_downloads == o.top_by_downloads
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [total_ever_seen, total_deleted, deletion_rate_pct, avg_months_alive, timeline, top_by_downloads].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ class DeletionSummaryTimelineInner < ApiModelBase
18
+ attr_accessor :month
19
+
20
+ attr_accessor :count
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'month' => :'month',
26
+ :'count' => :'count'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'month' => :'String',
44
+ :'count' => :'Integer'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DeletionSummaryTimelineInner` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DeletionSummaryTimelineInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'month')
71
+ self.month = attributes[:'month']
72
+ end
73
+
74
+ if attributes.key?(:'count')
75
+ self.count = attributes[:'count']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ month == o.month &&
100
+ count == o.count
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [month, count].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end