abliteration 0.1.8 → 0.1.9
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 +4 -4
- data/README.md +6 -0
- data/docs/DownloadAnomaly.md +32 -0
- data/docs/DownloadPoint.md +20 -0
- data/docs/GetModelDownloadHistory200Response.md +32 -0
- data/docs/ListAnomalies200Response.md +32 -0
- data/docs/ModelsApi.md +154 -0
- data/lib/abliteration/api/models_api.rb +174 -0
- data/lib/abliteration/models/download_anomaly.rb +250 -0
- data/lib/abliteration/models/download_point.rb +158 -0
- data/lib/abliteration/models/get_model_download_history200_response.rb +386 -0
- data/lib/abliteration/models/list_anomalies200_response.rb +386 -0
- data/lib/abliteration/version.rb +1 -1
- data/lib/abliteration.rb +4 -0
- data/spec/models/download_anomaly_spec.rb +82 -0
- data/spec/models/download_point_spec.rb +42 -0
- data/spec/models/get_model_download_history200_response_spec.rb +82 -0
- data/spec/models/list_anomalies200_response_spec.rb +82 -0
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b716c004351088508c4b5f1e556b0f629b7c4ebef25ff11b3e12463d4d8e20c
|
|
4
|
+
data.tar.gz: f8ffe5d532a2fda781136c741e4e636b5eaa46a6f51c986be6d87eddf3524f33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8136feaf6e57bcaa1b29146f686a62ff0b9603380daba943996a20d5032bbad148f61bb30fc0961b38df53ef9bd7e93a06d78cbec33f95f1984f6f00f37c5478
|
|
7
|
+
data.tar.gz: 6e7c1d50e0ba3ff34e91131b586332176d8fcbbd1e6f700af217226428417d18f877f1d822e67dc5d85cd317cd7286ef5a3bbbfb8ad84f61976a9b982f9417c5
|
data/README.md
CHANGED
|
@@ -99,7 +99,9 @@ Class | Method | HTTP request | Description
|
|
|
99
99
|
*Abliteration::MethodsApi* | [**list_methods**](docs/MethodsApi.md#list_methods) | **GET** /api/v1/methods | List the method taxonomy
|
|
100
100
|
*Abliteration::ModelsApi* | [**get_historical_deletion_summary**](docs/ModelsApi.md#get_historical_deletion_summary) | **GET** /api/v1/models/historical-deletions/summary | Historical deletions — aggregate summary
|
|
101
101
|
*Abliteration::ModelsApi* | [**get_model**](docs/ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model
|
|
102
|
+
*Abliteration::ModelsApi* | [**get_model_download_history**](docs/ModelsApi.md#get_model_download_history) | **GET** /api/v1/models/{id}/download-history | Per-model download timeline
|
|
102
103
|
*Abliteration::ModelsApi* | [**get_model_readme_at**](docs/ModelsApi.md#get_model_readme_at) | **GET** /api/v1/models/{id}/readme-at/{commit} | README content at one commit (wayback)
|
|
104
|
+
*Abliteration::ModelsApi* | [**list_anomalies**](docs/ModelsApi.md#list_anomalies) | **GET** /api/v1/market/anomalies | Anomalies in the download counter (change stream)
|
|
103
105
|
*Abliteration::ModelsApi* | [**list_delisted_models**](docs/ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream)
|
|
104
106
|
*Abliteration::ModelsApi* | [**list_historical_deletions**](docs/ModelsApi.md#list_historical_deletions) | **GET** /api/v1/models/historical-deletions/list | Historical deletions — paged list
|
|
105
107
|
*Abliteration::ModelsApi* | [**list_model_readme_drifts**](docs/ModelsApi.md#list_model_readme_drifts) | **GET** /api/v1/models/{id}/drifts | README drift stream for one model
|
|
@@ -118,6 +120,8 @@ Class | Method | HTTP request | Description
|
|
|
118
120
|
- [Abliteration::DeletionSummaryTimelineInner](docs/DeletionSummaryTimelineInner.md)
|
|
119
121
|
- [Abliteration::DeletionSummaryTopByDownloadsInner](docs/DeletionSummaryTopByDownloadsInner.md)
|
|
120
122
|
- [Abliteration::DelistedModel](docs/DelistedModel.md)
|
|
123
|
+
- [Abliteration::DownloadAnomaly](docs/DownloadAnomaly.md)
|
|
124
|
+
- [Abliteration::DownloadPoint](docs/DownloadPoint.md)
|
|
121
125
|
- [Abliteration::Envelope](docs/Envelope.md)
|
|
122
126
|
- [Abliteration::Error](docs/Error.md)
|
|
123
127
|
- [Abliteration::Event](docs/Event.md)
|
|
@@ -127,10 +131,12 @@ Class | Method | HTTP request | Description
|
|
|
127
131
|
- [Abliteration::GetIndex200Response](docs/GetIndex200Response.md)
|
|
128
132
|
- [Abliteration::GetMethod200Response](docs/GetMethod200Response.md)
|
|
129
133
|
- [Abliteration::GetModel200Response](docs/GetModel200Response.md)
|
|
134
|
+
- [Abliteration::GetModelDownloadHistory200Response](docs/GetModelDownloadHistory200Response.md)
|
|
130
135
|
- [Abliteration::GetModelReadmeAt200Response](docs/GetModelReadmeAt200Response.md)
|
|
131
136
|
- [Abliteration::HistoricalDeletion](docs/HistoricalDeletion.md)
|
|
132
137
|
- [Abliteration::Index](docs/Index.md)
|
|
133
138
|
- [Abliteration::IndexDetail](docs/IndexDetail.md)
|
|
139
|
+
- [Abliteration::ListAnomalies200Response](docs/ListAnomalies200Response.md)
|
|
134
140
|
- [Abliteration::ListAuthors200Response](docs/ListAuthors200Response.md)
|
|
135
141
|
- [Abliteration::ListDatasets200Response](docs/ListDatasets200Response.md)
|
|
136
142
|
- [Abliteration::ListDelistedModels200Response](docs/ListDelistedModels200Response.md)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Abliteration::DownloadAnomaly
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **model_id** | **String** | | [optional] |
|
|
8
|
+
| **current_at** | **String** | ISO-8601 timestamp of the current snapshot. | [optional] |
|
|
9
|
+
| **current_downloads** | **Integer** | | [optional] |
|
|
10
|
+
| **baseline_at** | **String** | ISO-8601 timestamp of the baseline snapshot the delta is computed against. | [optional] |
|
|
11
|
+
| **baseline_downloads** | **Integer** | | [optional] |
|
|
12
|
+
| **ratio** | **Float** | current_downloads / baseline_downloads. | [optional] |
|
|
13
|
+
| **delta** | **Integer** | current_downloads - baseline_downloads (signed). | [optional] |
|
|
14
|
+
| **kind** | **String** | `spike` when ratio >= 2, `drop` when ratio <= 0.5. | [optional] |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'abliteration'
|
|
20
|
+
|
|
21
|
+
instance = Abliteration::DownloadAnomaly.new(
|
|
22
|
+
model_id: null,
|
|
23
|
+
current_at: null,
|
|
24
|
+
current_downloads: null,
|
|
25
|
+
baseline_at: null,
|
|
26
|
+
baseline_downloads: null,
|
|
27
|
+
ratio: null,
|
|
28
|
+
delta: null,
|
|
29
|
+
kind: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Abliteration::DownloadPoint
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **date** | **String** | ISO-8601 timestamp of the observation. | [optional] |
|
|
8
|
+
| **downloads** | **Integer** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'abliteration'
|
|
14
|
+
|
|
15
|
+
instance = Abliteration::DownloadPoint.new(
|
|
16
|
+
date: null,
|
|
17
|
+
downloads: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Abliteration::GetModelDownloadHistory200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**Array<DownloadPoint>**](DownloadPoint.md) | | |
|
|
8
|
+
| **cost** | **Integer** | Credits this call costs. | |
|
|
9
|
+
| **credits_remaining** | **Integer** | Wallet balance after the call. Unchanged while metering is preview. | |
|
|
10
|
+
| **rate_limit_limit** | **Integer** | Ceiling for the current window. Also returned as X-RateLimit-Limit. | |
|
|
11
|
+
| **rate_limit_remaining** | **Integer** | Calls left in the current window for this key. Also returned as X-RateLimit-Remaining. | |
|
|
12
|
+
| **rate_limit_reset** | **Integer** | Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset. | |
|
|
13
|
+
| **metering** | **String** | Whether cost was actually deducted. | |
|
|
14
|
+
| **request_id** | **String** | Also returned in the x-request-id header. | |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'abliteration'
|
|
20
|
+
|
|
21
|
+
instance = Abliteration::GetModelDownloadHistory200Response.new(
|
|
22
|
+
data: null,
|
|
23
|
+
cost: null,
|
|
24
|
+
credits_remaining: null,
|
|
25
|
+
rate_limit_limit: null,
|
|
26
|
+
rate_limit_remaining: null,
|
|
27
|
+
rate_limit_reset: null,
|
|
28
|
+
metering: null,
|
|
29
|
+
request_id: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Abliteration::ListAnomalies200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**Array<DownloadAnomaly>**](DownloadAnomaly.md) | | |
|
|
8
|
+
| **cost** | **Integer** | Credits this call costs. | |
|
|
9
|
+
| **credits_remaining** | **Integer** | Wallet balance after the call. Unchanged while metering is preview. | |
|
|
10
|
+
| **rate_limit_limit** | **Integer** | Ceiling for the current window. Also returned as X-RateLimit-Limit. | |
|
|
11
|
+
| **rate_limit_remaining** | **Integer** | Calls left in the current window for this key. Also returned as X-RateLimit-Remaining. | |
|
|
12
|
+
| **rate_limit_reset** | **Integer** | Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset. | |
|
|
13
|
+
| **metering** | **String** | Whether cost was actually deducted. | |
|
|
14
|
+
| **request_id** | **String** | Also returned in the x-request-id header. | |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'abliteration'
|
|
20
|
+
|
|
21
|
+
instance = Abliteration::ListAnomalies200Response.new(
|
|
22
|
+
data: null,
|
|
23
|
+
cost: null,
|
|
24
|
+
credits_remaining: null,
|
|
25
|
+
rate_limit_limit: null,
|
|
26
|
+
rate_limit_remaining: null,
|
|
27
|
+
rate_limit_reset: null,
|
|
28
|
+
metering: null,
|
|
29
|
+
request_id: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
data/docs/ModelsApi.md
CHANGED
|
@@ -6,7 +6,9 @@ All URIs are relative to *https://abliteration.org*
|
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**get_historical_deletion_summary**](ModelsApi.md#get_historical_deletion_summary) | **GET** /api/v1/models/historical-deletions/summary | Historical deletions — aggregate summary |
|
|
8
8
|
| [**get_model**](ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model |
|
|
9
|
+
| [**get_model_download_history**](ModelsApi.md#get_model_download_history) | **GET** /api/v1/models/{id}/download-history | Per-model download timeline |
|
|
9
10
|
| [**get_model_readme_at**](ModelsApi.md#get_model_readme_at) | **GET** /api/v1/models/{id}/readme-at/{commit} | README content at one commit (wayback) |
|
|
11
|
+
| [**list_anomalies**](ModelsApi.md#list_anomalies) | **GET** /api/v1/market/anomalies | Anomalies in the download counter (change stream) |
|
|
10
12
|
| [**list_delisted_models**](ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream) |
|
|
11
13
|
| [**list_historical_deletions**](ModelsApi.md#list_historical_deletions) | **GET** /api/v1/models/historical-deletions/list | Historical deletions — paged list |
|
|
12
14
|
| [**list_model_readme_drifts**](ModelsApi.md#list_model_readme_drifts) | **GET** /api/v1/models/{id}/drifts | README drift stream for one model |
|
|
@@ -148,6 +150,79 @@ end
|
|
|
148
150
|
- **Accept**: application/json
|
|
149
151
|
|
|
150
152
|
|
|
153
|
+
## get_model_download_history
|
|
154
|
+
|
|
155
|
+
> <GetModelDownloadHistory200Response> get_model_download_history(id, opts)
|
|
156
|
+
|
|
157
|
+
Per-model download timeline
|
|
158
|
+
|
|
159
|
+
Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
|
|
160
|
+
|
|
161
|
+
### Examples
|
|
162
|
+
|
|
163
|
+
```ruby
|
|
164
|
+
require 'time'
|
|
165
|
+
require 'abliteration'
|
|
166
|
+
# setup authorization
|
|
167
|
+
Abliteration.configure do |config|
|
|
168
|
+
# Configure Bearer authorization: bearerAuth
|
|
169
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
api_instance = Abliteration::ModelsApi.new
|
|
173
|
+
id = 'id_example' # String |
|
|
174
|
+
opts = {
|
|
175
|
+
days: 56 # Integer | Window in days (max 365). Pass 0 for full history.
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
begin
|
|
179
|
+
# Per-model download timeline
|
|
180
|
+
result = api_instance.get_model_download_history(id, opts)
|
|
181
|
+
p result
|
|
182
|
+
rescue Abliteration::ApiError => e
|
|
183
|
+
puts "Error when calling ModelsApi->get_model_download_history: #{e}"
|
|
184
|
+
end
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### Using the get_model_download_history_with_http_info variant
|
|
188
|
+
|
|
189
|
+
This returns an Array which contains the response data, status code and headers.
|
|
190
|
+
|
|
191
|
+
> <Array(<GetModelDownloadHistory200Response>, Integer, Hash)> get_model_download_history_with_http_info(id, opts)
|
|
192
|
+
|
|
193
|
+
```ruby
|
|
194
|
+
begin
|
|
195
|
+
# Per-model download timeline
|
|
196
|
+
data, status_code, headers = api_instance.get_model_download_history_with_http_info(id, opts)
|
|
197
|
+
p status_code # => 2xx
|
|
198
|
+
p headers # => { ... }
|
|
199
|
+
p data # => <GetModelDownloadHistory200Response>
|
|
200
|
+
rescue Abliteration::ApiError => e
|
|
201
|
+
puts "Error when calling ModelsApi->get_model_download_history_with_http_info: #{e}"
|
|
202
|
+
end
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Parameters
|
|
206
|
+
|
|
207
|
+
| Name | Type | Description | Notes |
|
|
208
|
+
| ---- | ---- | ----------- | ----- |
|
|
209
|
+
| **id** | **String** | | |
|
|
210
|
+
| **days** | **Integer** | Window in days (max 365). Pass 0 for full history. | [optional][default to 90] |
|
|
211
|
+
|
|
212
|
+
### Return type
|
|
213
|
+
|
|
214
|
+
[**GetModelDownloadHistory200Response**](GetModelDownloadHistory200Response.md)
|
|
215
|
+
|
|
216
|
+
### Authorization
|
|
217
|
+
|
|
218
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
219
|
+
|
|
220
|
+
### HTTP request headers
|
|
221
|
+
|
|
222
|
+
- **Content-Type**: Not defined
|
|
223
|
+
- **Accept**: application/json
|
|
224
|
+
|
|
225
|
+
|
|
151
226
|
## get_model_readme_at
|
|
152
227
|
|
|
153
228
|
> <GetModelReadmeAt200Response> get_model_readme_at(id, commit)
|
|
@@ -219,6 +294,85 @@ end
|
|
|
219
294
|
- **Accept**: application/json
|
|
220
295
|
|
|
221
296
|
|
|
297
|
+
## list_anomalies
|
|
298
|
+
|
|
299
|
+
> <ListAnomalies200Response> list_anomalies(opts)
|
|
300
|
+
|
|
301
|
+
Anomalies in the download counter (change stream)
|
|
302
|
+
|
|
303
|
+
Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
|
|
304
|
+
|
|
305
|
+
### Examples
|
|
306
|
+
|
|
307
|
+
```ruby
|
|
308
|
+
require 'time'
|
|
309
|
+
require 'abliteration'
|
|
310
|
+
# setup authorization
|
|
311
|
+
Abliteration.configure do |config|
|
|
312
|
+
# Configure Bearer authorization: bearerAuth
|
|
313
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
api_instance = Abliteration::ModelsApi.new
|
|
317
|
+
opts = {
|
|
318
|
+
window_days: 56, # Integer | Baseline distance in days. Default 7, min 1, max 365.
|
|
319
|
+
min_baseline: 56, # Integer | Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000.
|
|
320
|
+
kind: 'spike', # String | Filter to one class. Omit for both.
|
|
321
|
+
limit: 56, # Integer | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
322
|
+
offset: 56 # Integer | Rows to skip. Negative and non-numeric values are treated as 0.
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
begin
|
|
326
|
+
# Anomalies in the download counter (change stream)
|
|
327
|
+
result = api_instance.list_anomalies(opts)
|
|
328
|
+
p result
|
|
329
|
+
rescue Abliteration::ApiError => e
|
|
330
|
+
puts "Error when calling ModelsApi->list_anomalies: #{e}"
|
|
331
|
+
end
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### Using the list_anomalies_with_http_info variant
|
|
335
|
+
|
|
336
|
+
This returns an Array which contains the response data, status code and headers.
|
|
337
|
+
|
|
338
|
+
> <Array(<ListAnomalies200Response>, Integer, Hash)> list_anomalies_with_http_info(opts)
|
|
339
|
+
|
|
340
|
+
```ruby
|
|
341
|
+
begin
|
|
342
|
+
# Anomalies in the download counter (change stream)
|
|
343
|
+
data, status_code, headers = api_instance.list_anomalies_with_http_info(opts)
|
|
344
|
+
p status_code # => 2xx
|
|
345
|
+
p headers # => { ... }
|
|
346
|
+
p data # => <ListAnomalies200Response>
|
|
347
|
+
rescue Abliteration::ApiError => e
|
|
348
|
+
puts "Error when calling ModelsApi->list_anomalies_with_http_info: #{e}"
|
|
349
|
+
end
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Parameters
|
|
353
|
+
|
|
354
|
+
| Name | Type | Description | Notes |
|
|
355
|
+
| ---- | ---- | ----------- | ----- |
|
|
356
|
+
| **window_days** | **Integer** | Baseline distance in days. Default 7, min 1, max 365. | [optional][default to 7] |
|
|
357
|
+
| **min_baseline** | **Integer** | Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000. | [optional][default to 1000] |
|
|
358
|
+
| **kind** | **String** | Filter to one class. Omit for both. | [optional] |
|
|
359
|
+
| **limit** | **Integer** | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. | [optional][default to 50] |
|
|
360
|
+
| **offset** | **Integer** | Rows to skip. Negative and non-numeric values are treated as 0. | [optional][default to 0] |
|
|
361
|
+
|
|
362
|
+
### Return type
|
|
363
|
+
|
|
364
|
+
[**ListAnomalies200Response**](ListAnomalies200Response.md)
|
|
365
|
+
|
|
366
|
+
### Authorization
|
|
367
|
+
|
|
368
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
369
|
+
|
|
370
|
+
### HTTP request headers
|
|
371
|
+
|
|
372
|
+
- **Content-Type**: Not defined
|
|
373
|
+
- **Accept**: application/json
|
|
374
|
+
|
|
375
|
+
|
|
222
376
|
## list_delisted_models
|
|
223
377
|
|
|
224
378
|
> <ListDelistedModels200Response> list_delisted_models(opts)
|
|
@@ -139,6 +139,80 @@ module Abliteration
|
|
|
139
139
|
return data, status_code, headers
|
|
140
140
|
end
|
|
141
141
|
|
|
142
|
+
# Per-model download timeline
|
|
143
|
+
# Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
|
|
144
|
+
# @param id [String]
|
|
145
|
+
# @param [Hash] opts the optional parameters
|
|
146
|
+
# @option opts [Integer] :days Window in days (max 365). Pass 0 for full history. (default to 90)
|
|
147
|
+
# @return [GetModelDownloadHistory200Response]
|
|
148
|
+
def get_model_download_history(id, opts = {})
|
|
149
|
+
data, _status_code, _headers = get_model_download_history_with_http_info(id, opts)
|
|
150
|
+
data
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Per-model download timeline
|
|
154
|
+
# Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
|
|
155
|
+
# @param id [String]
|
|
156
|
+
# @param [Hash] opts the optional parameters
|
|
157
|
+
# @option opts [Integer] :days Window in days (max 365). Pass 0 for full history. (default to 90)
|
|
158
|
+
# @return [Array<(GetModelDownloadHistory200Response, Integer, Hash)>] GetModelDownloadHistory200Response data, response status code and response headers
|
|
159
|
+
def get_model_download_history_with_http_info(id, opts = {})
|
|
160
|
+
if @api_client.config.debugging
|
|
161
|
+
@api_client.config.logger.debug 'Calling API: ModelsApi.get_model_download_history ...'
|
|
162
|
+
end
|
|
163
|
+
# verify the required parameter 'id' is set
|
|
164
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
165
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ModelsApi.get_model_download_history"
|
|
166
|
+
end
|
|
167
|
+
if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 365
|
|
168
|
+
fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ModelsApi.get_model_download_history, must be smaller than or equal to 365.'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 0
|
|
172
|
+
fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ModelsApi.get_model_download_history, must be greater than or equal to 0.'
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# resource path
|
|
176
|
+
local_var_path = '/api/v1/models/{id}/download-history'.sub('{id}', CGI.escape(id.to_s))
|
|
177
|
+
|
|
178
|
+
# query parameters
|
|
179
|
+
query_params = opts[:query_params] || {}
|
|
180
|
+
query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
186
|
+
|
|
187
|
+
# form parameters
|
|
188
|
+
form_params = opts[:form_params] || {}
|
|
189
|
+
|
|
190
|
+
# http body (model)
|
|
191
|
+
post_body = opts[:debug_body]
|
|
192
|
+
|
|
193
|
+
# return_type
|
|
194
|
+
return_type = opts[:debug_return_type] || 'GetModelDownloadHistory200Response'
|
|
195
|
+
|
|
196
|
+
# auth_names
|
|
197
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
198
|
+
|
|
199
|
+
new_options = opts.merge(
|
|
200
|
+
:operation => :"ModelsApi.get_model_download_history",
|
|
201
|
+
:header_params => header_params,
|
|
202
|
+
:query_params => query_params,
|
|
203
|
+
:form_params => form_params,
|
|
204
|
+
:body => post_body,
|
|
205
|
+
:auth_names => auth_names,
|
|
206
|
+
:return_type => return_type
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
210
|
+
if @api_client.config.debugging
|
|
211
|
+
@api_client.config.logger.debug "API called: ModelsApi#get_model_download_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
212
|
+
end
|
|
213
|
+
return data, status_code, headers
|
|
214
|
+
end
|
|
215
|
+
|
|
142
216
|
# README content at one commit (wayback)
|
|
143
217
|
# Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
|
|
144
218
|
# @param id [String]
|
|
@@ -208,6 +282,106 @@ module Abliteration
|
|
|
208
282
|
return data, status_code, headers
|
|
209
283
|
end
|
|
210
284
|
|
|
285
|
+
# Anomalies in the download counter (change stream)
|
|
286
|
+
# Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
|
|
287
|
+
# @param [Hash] opts the optional parameters
|
|
288
|
+
# @option opts [Integer] :window_days Baseline distance in days. Default 7, min 1, max 365. (default to 7)
|
|
289
|
+
# @option opts [Integer] :min_baseline Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000. (default to 1000)
|
|
290
|
+
# @option opts [String] :kind Filter to one class. Omit for both.
|
|
291
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
292
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
293
|
+
# @return [ListAnomalies200Response]
|
|
294
|
+
def list_anomalies(opts = {})
|
|
295
|
+
data, _status_code, _headers = list_anomalies_with_http_info(opts)
|
|
296
|
+
data
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Anomalies in the download counter (change stream)
|
|
300
|
+
# Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @option opts [Integer] :window_days Baseline distance in days. Default 7, min 1, max 365. (default to 7)
|
|
303
|
+
# @option opts [Integer] :min_baseline Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000. (default to 1000)
|
|
304
|
+
# @option opts [String] :kind Filter to one class. Omit for both.
|
|
305
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
306
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
307
|
+
# @return [Array<(ListAnomalies200Response, Integer, Hash)>] ListAnomalies200Response data, response status code and response headers
|
|
308
|
+
def list_anomalies_with_http_info(opts = {})
|
|
309
|
+
if @api_client.config.debugging
|
|
310
|
+
@api_client.config.logger.debug 'Calling API: ModelsApi.list_anomalies ...'
|
|
311
|
+
end
|
|
312
|
+
if @api_client.config.client_side_validation && !opts[:'window_days'].nil? && opts[:'window_days'] > 365
|
|
313
|
+
fail ArgumentError, 'invalid value for "opts[:"window_days"]" when calling ModelsApi.list_anomalies, must be smaller than or equal to 365.'
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
if @api_client.config.client_side_validation && !opts[:'window_days'].nil? && opts[:'window_days'] < 1
|
|
317
|
+
fail ArgumentError, 'invalid value for "opts[:"window_days"]" when calling ModelsApi.list_anomalies, must be greater than or equal to 1.'
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
if @api_client.config.client_side_validation && !opts[:'min_baseline'].nil? && opts[:'min_baseline'] < 1
|
|
321
|
+
fail ArgumentError, 'invalid value for "opts[:"min_baseline"]" when calling ModelsApi.list_anomalies, must be greater than or equal to 1.'
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
allowable_values = ["spike", "drop"]
|
|
325
|
+
if @api_client.config.client_side_validation && opts[:'kind'] && !allowable_values.include?(opts[:'kind'])
|
|
326
|
+
fail ArgumentError, "invalid value for \"kind\", must be one of #{allowable_values}"
|
|
327
|
+
end
|
|
328
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
329
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_anomalies, must be smaller than or equal to 1000.'
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
333
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_anomalies, must be greater than or equal to 1.'
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
337
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_anomalies, must be greater than or equal to 0.'
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# resource path
|
|
341
|
+
local_var_path = '/api/v1/market/anomalies'
|
|
342
|
+
|
|
343
|
+
# query parameters
|
|
344
|
+
query_params = opts[:query_params] || {}
|
|
345
|
+
query_params[:'window_days'] = opts[:'window_days'] if !opts[:'window_days'].nil?
|
|
346
|
+
query_params[:'min_baseline'] = opts[:'min_baseline'] if !opts[:'min_baseline'].nil?
|
|
347
|
+
query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil?
|
|
348
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
349
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
350
|
+
|
|
351
|
+
# header parameters
|
|
352
|
+
header_params = opts[:header_params] || {}
|
|
353
|
+
# HTTP header 'Accept' (if needed)
|
|
354
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
355
|
+
|
|
356
|
+
# form parameters
|
|
357
|
+
form_params = opts[:form_params] || {}
|
|
358
|
+
|
|
359
|
+
# http body (model)
|
|
360
|
+
post_body = opts[:debug_body]
|
|
361
|
+
|
|
362
|
+
# return_type
|
|
363
|
+
return_type = opts[:debug_return_type] || 'ListAnomalies200Response'
|
|
364
|
+
|
|
365
|
+
# auth_names
|
|
366
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
367
|
+
|
|
368
|
+
new_options = opts.merge(
|
|
369
|
+
:operation => :"ModelsApi.list_anomalies",
|
|
370
|
+
:header_params => header_params,
|
|
371
|
+
:query_params => query_params,
|
|
372
|
+
:form_params => form_params,
|
|
373
|
+
:body => post_body,
|
|
374
|
+
:auth_names => auth_names,
|
|
375
|
+
:return_type => return_type
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
379
|
+
if @api_client.config.debugging
|
|
380
|
+
@api_client.config.logger.debug "API called: ModelsApi#list_anomalies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
381
|
+
end
|
|
382
|
+
return data, status_code, headers
|
|
383
|
+
end
|
|
384
|
+
|
|
211
385
|
# List delisted models (change stream)
|
|
212
386
|
# 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.
|
|
213
387
|
# @param [Hash] opts the optional parameters
|