abliteration 0.0.1 → 0.1.1
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/Gemfile +9 -0
- data/README.md +135 -9
- data/Rakefile +10 -0
- data/abliteration.gemspec +38 -21
- data/docs/Author.md +28 -0
- data/docs/AuthorDetail.md +30 -0
- data/docs/AuthorsApi.md +153 -0
- data/docs/DaiPoint.md +22 -0
- data/docs/Dataset.md +38 -0
- data/docs/DatasetDetail.md +22 -0
- data/docs/DatasetsApi.md +159 -0
- data/docs/Envelope.md +32 -0
- data/docs/Error.md +26 -0
- data/docs/Event.md +30 -0
- data/docs/GetAuthor200Response.md +32 -0
- data/docs/GetDataset200Response.md +32 -0
- data/docs/GetIndex200Response.md +32 -0
- data/docs/GetMethod200Response.md +32 -0
- data/docs/GetModel200Response.md +32 -0
- data/docs/Index.md +36 -0
- data/docs/IndexDetail.md +38 -0
- data/docs/IndicesApi.md +144 -0
- data/docs/ListAuthors200Response.md +32 -0
- data/docs/ListDatasets200Response.md +32 -0
- data/docs/ListIndices200Response.md +32 -0
- data/docs/ListMethods200Response.md +32 -0
- data/docs/ListModels200Response.md +32 -0
- data/docs/ListTimeline200Response.md +32 -0
- data/docs/Method.md +28 -0
- data/docs/MethodDetail.md +34 -0
- data/docs/MethodDetailAllOfTopAuthors.md +20 -0
- data/docs/MethodsApi.md +144 -0
- data/docs/ModelDetail.md +28 -0
- data/docs/ModelSummary.md +42 -0
- data/docs/ModelsApi.md +169 -0
- data/docs/Passport.md +22 -0
- data/docs/TimelineApi.md +85 -0
- data/git_push.sh +54 -0
- data/lib/abliteration/api/authors_api.rb +167 -0
- data/lib/abliteration/api/datasets_api.rb +176 -0
- data/lib/abliteration/api/indices_api.rb +147 -0
- data/lib/abliteration/api/methods_api.rb +147 -0
- data/lib/abliteration/api/models_api.rb +191 -0
- data/lib/abliteration/api/timeline_api.rb +99 -0
- data/lib/abliteration/api_client.rb +397 -0
- data/lib/abliteration/api_error.rb +58 -0
- data/lib/abliteration/api_model_base.rb +88 -0
- data/lib/abliteration/configuration.rb +308 -0
- data/lib/abliteration/models/author.rb +194 -0
- data/lib/abliteration/models/author_detail.rb +211 -0
- data/lib/abliteration/models/dai_point.rb +165 -0
- data/lib/abliteration/models/dataset.rb +247 -0
- data/lib/abliteration/models/dataset_detail.rb +169 -0
- data/lib/abliteration/models/envelope.rb +364 -0
- data/lib/abliteration/models/error.rb +221 -0
- data/lib/abliteration/models/event.rb +207 -0
- data/lib/abliteration/models/get_author200_response.rb +384 -0
- data/lib/abliteration/models/get_dataset200_response.rb +384 -0
- data/lib/abliteration/models/get_index200_response.rb +384 -0
- data/lib/abliteration/models/get_method200_response.rb +384 -0
- data/lib/abliteration/models/get_model200_response.rb +384 -0
- data/lib/abliteration/models/index.rb +281 -0
- data/lib/abliteration/models/index_detail.rb +296 -0
- data/lib/abliteration/models/list_authors200_response.rb +386 -0
- data/lib/abliteration/models/list_datasets200_response.rb +386 -0
- data/lib/abliteration/models/list_indices200_response.rb +386 -0
- data/lib/abliteration/models/list_methods200_response.rb +386 -0
- data/lib/abliteration/models/list_models200_response.rb +386 -0
- data/lib/abliteration/models/list_timeline200_response.rb +386 -0
- data/lib/abliteration/models/method.rb +227 -0
- data/lib/abliteration/models/method_detail.rb +265 -0
- data/lib/abliteration/models/method_detail_all_of_top_authors.rb +156 -0
- data/lib/abliteration/models/model_detail.rb +196 -0
- data/lib/abliteration/models/model_summary.rb +265 -0
- data/lib/abliteration/models/passport.rb +165 -0
- data/lib/abliteration/version.rb +15 -0
- data/lib/abliteration.rb +69 -24
- data/openapi-generator-config.json +12 -0
- data/spec/api/authors_api_spec.rb +61 -0
- data/spec/api/datasets_api_spec.rb +64 -0
- data/spec/api/indices_api_spec.rb +58 -0
- data/spec/api/methods_api_spec.rb +58 -0
- data/spec/api/models_api_spec.rb +69 -0
- data/spec/api/timeline_api_spec.rb +50 -0
- data/spec/models/author_detail_spec.rb +66 -0
- data/spec/models/author_spec.rb +60 -0
- data/spec/models/dai_point_spec.rb +48 -0
- data/spec/models/dataset_detail_spec.rb +48 -0
- data/spec/models/dataset_spec.rb +96 -0
- data/spec/models/envelope_spec.rb +82 -0
- data/spec/models/error_spec.rb +60 -0
- data/spec/models/event_spec.rb +72 -0
- data/spec/models/get_author200_response_spec.rb +82 -0
- data/spec/models/get_dataset200_response_spec.rb +82 -0
- data/spec/models/get_index200_response_spec.rb +82 -0
- data/spec/models/get_method200_response_spec.rb +82 -0
- data/spec/models/get_model200_response_spec.rb +82 -0
- data/spec/models/index_detail_spec.rb +104 -0
- data/spec/models/index_spec.rb +98 -0
- data/spec/models/list_authors200_response_spec.rb +82 -0
- data/spec/models/list_datasets200_response_spec.rb +82 -0
- data/spec/models/list_indices200_response_spec.rb +82 -0
- data/spec/models/list_methods200_response_spec.rb +82 -0
- data/spec/models/list_models200_response_spec.rb +82 -0
- data/spec/models/list_timeline200_response_spec.rb +82 -0
- data/spec/models/method_detail_all_of_top_authors_spec.rb +42 -0
- data/spec/models/method_detail_spec.rb +88 -0
- data/spec/models/method_spec.rb +70 -0
- data/spec/models/model_detail_spec.rb +66 -0
- data/spec/models/model_summary_spec.rb +108 -0
- data/spec/models/passport_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +197 -17
data/docs/TimelineApi.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Abliteration::TimelineApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://abliteration.org*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**list_timeline**](TimelineApi.md#list_timeline) | **GET** /api/v1/timeline | Curated field events |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## list_timeline
|
|
11
|
+
|
|
12
|
+
> <ListTimeline200Response> list_timeline(opts)
|
|
13
|
+
|
|
14
|
+
Curated field events
|
|
15
|
+
|
|
16
|
+
Cost: 50 credits, flat.
|
|
17
|
+
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
require 'time'
|
|
22
|
+
require 'abliteration'
|
|
23
|
+
# setup authorization
|
|
24
|
+
Abliteration.configure do |config|
|
|
25
|
+
# Configure Bearer authorization: bearerAuth
|
|
26
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
api_instance = Abliteration::TimelineApi.new
|
|
30
|
+
opts = {
|
|
31
|
+
from: 'from_example', # String | Inclusive lower bound on the event date, ISO-8601.
|
|
32
|
+
to: 'to_example', # String | Inclusive upper bound on the event date, ISO-8601.
|
|
33
|
+
event_type: 'event_type_example', # String | Event type, case-insensitive.
|
|
34
|
+
limit: 56 # Integer |
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
begin
|
|
38
|
+
# Curated field events
|
|
39
|
+
result = api_instance.list_timeline(opts)
|
|
40
|
+
p result
|
|
41
|
+
rescue Abliteration::ApiError => e
|
|
42
|
+
puts "Error when calling TimelineApi->list_timeline: #{e}"
|
|
43
|
+
end
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### Using the list_timeline_with_http_info variant
|
|
47
|
+
|
|
48
|
+
This returns an Array which contains the response data, status code and headers.
|
|
49
|
+
|
|
50
|
+
> <Array(<ListTimeline200Response>, Integer, Hash)> list_timeline_with_http_info(opts)
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
begin
|
|
54
|
+
# Curated field events
|
|
55
|
+
data, status_code, headers = api_instance.list_timeline_with_http_info(opts)
|
|
56
|
+
p status_code # => 2xx
|
|
57
|
+
p headers # => { ... }
|
|
58
|
+
p data # => <ListTimeline200Response>
|
|
59
|
+
rescue Abliteration::ApiError => e
|
|
60
|
+
puts "Error when calling TimelineApi->list_timeline_with_http_info: #{e}"
|
|
61
|
+
end
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Parameters
|
|
65
|
+
|
|
66
|
+
| Name | Type | Description | Notes |
|
|
67
|
+
| ---- | ---- | ----------- | ----- |
|
|
68
|
+
| **from** | **String** | Inclusive lower bound on the event date, ISO-8601. | [optional] |
|
|
69
|
+
| **to** | **String** | Inclusive upper bound on the event date, ISO-8601. | [optional] |
|
|
70
|
+
| **event_type** | **String** | Event type, case-insensitive. | [optional] |
|
|
71
|
+
| **limit** | **Integer** | | [optional][default to 100] |
|
|
72
|
+
|
|
73
|
+
### Return type
|
|
74
|
+
|
|
75
|
+
[**ListTimeline200Response**](ListTimeline200Response.md)
|
|
76
|
+
|
|
77
|
+
### Authorization
|
|
78
|
+
|
|
79
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
80
|
+
|
|
81
|
+
### HTTP request headers
|
|
82
|
+
|
|
83
|
+
- **Content-Type**: Not defined
|
|
84
|
+
- **Accept**: application/json
|
|
85
|
+
|
data/git_push.sh
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
3
|
+
#
|
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
|
5
|
+
|
|
6
|
+
git_user_id=$1
|
|
7
|
+
git_repo_id=$2
|
|
8
|
+
release_note=$3
|
|
9
|
+
git_host=$4
|
|
10
|
+
|
|
11
|
+
if [ -z "${git_host}" ]; then
|
|
12
|
+
git_host="github.com"
|
|
13
|
+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ -z "${git_user_id}" ]; then
|
|
17
|
+
git_user_id="GIT_USER_ID"
|
|
18
|
+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ -z "${git_repo_id}" ]; then
|
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
|
23
|
+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [ -z "${release_note}" ]; then
|
|
27
|
+
release_note="Minor update"
|
|
28
|
+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Initialize the local directory as a Git repository
|
|
32
|
+
git init
|
|
33
|
+
|
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
|
35
|
+
git add .
|
|
36
|
+
|
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
38
|
+
git commit -m "${release_note}"
|
|
39
|
+
|
|
40
|
+
# Sets the new remote
|
|
41
|
+
if [ -z "$(git remote)" ]; then # git remote not defined
|
|
42
|
+
if [ -z "${GIT_TOKEN:-}" ]; then
|
|
43
|
+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
|
|
44
|
+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
45
|
+
else
|
|
46
|
+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
git pull origin master
|
|
51
|
+
|
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
53
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
|
@@ -0,0 +1,167 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Abliteration
|
|
16
|
+
class AuthorsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get one author
|
|
23
|
+
# Cost: 1 credit.
|
|
24
|
+
# @param id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetAuthor200Response]
|
|
27
|
+
def get_author(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_author_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get one author
|
|
33
|
+
# Cost: 1 credit.
|
|
34
|
+
# @param id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetAuthor200Response, Integer, Hash)>] GetAuthor200Response data, response status code and response headers
|
|
37
|
+
def get_author_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AuthorsApi.get_author ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AuthorsApi.get_author"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/authors/{id}'.sub('{id}', CGI.escape(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] || 'GetAuthor200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"AuthorsApi.get_author",
|
|
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: AuthorsApi#get_author\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List authors
|
|
86
|
+
# Cost: 5-15 credits, by rows returned.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [String] :sort Bare key is DESC (largest first); a leading `-` flips to ASC. Aliases: `downloads` == `total_downloads`, `models` == `total_models`, `likes` == `total_likes`. (default to 'total_downloads')
|
|
89
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
90
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
91
|
+
# @return [ListAuthors200Response]
|
|
92
|
+
def list_authors(opts = {})
|
|
93
|
+
data, _status_code, _headers = list_authors_with_http_info(opts)
|
|
94
|
+
data
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# List authors
|
|
98
|
+
# Cost: 5-15 credits, by rows returned.
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [String] :sort Bare key is DESC (largest first); a leading `-` flips to ASC. Aliases: `downloads` == `total_downloads`, `models` == `total_models`, `likes` == `total_likes`. (default to 'total_downloads')
|
|
101
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
102
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
103
|
+
# @return [Array<(ListAuthors200Response, Integer, Hash)>] ListAuthors200Response data, response status code and response headers
|
|
104
|
+
def list_authors_with_http_info(opts = {})
|
|
105
|
+
if @api_client.config.debugging
|
|
106
|
+
@api_client.config.logger.debug 'Calling API: AuthorsApi.list_authors ...'
|
|
107
|
+
end
|
|
108
|
+
allowable_values = ["total_downloads", "-total_downloads", "downloads", "-downloads", "total_models", "-total_models", "models", "-models", "total_likes", "-total_likes", "likes", "-likes"]
|
|
109
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
110
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
111
|
+
end
|
|
112
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
113
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AuthorsApi.list_authors, must be smaller than or equal to 1000.'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
117
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AuthorsApi.list_authors, must be greater than or equal to 1.'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
121
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AuthorsApi.list_authors, must be greater than or equal to 0.'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# resource path
|
|
125
|
+
local_var_path = '/api/v1/authors'
|
|
126
|
+
|
|
127
|
+
# query parameters
|
|
128
|
+
query_params = opts[:query_params] || {}
|
|
129
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
130
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
131
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
132
|
+
|
|
133
|
+
# header parameters
|
|
134
|
+
header_params = opts[:header_params] || {}
|
|
135
|
+
# HTTP header 'Accept' (if needed)
|
|
136
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
137
|
+
|
|
138
|
+
# form parameters
|
|
139
|
+
form_params = opts[:form_params] || {}
|
|
140
|
+
|
|
141
|
+
# http body (model)
|
|
142
|
+
post_body = opts[:debug_body]
|
|
143
|
+
|
|
144
|
+
# return_type
|
|
145
|
+
return_type = opts[:debug_return_type] || 'ListAuthors200Response'
|
|
146
|
+
|
|
147
|
+
# auth_names
|
|
148
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
149
|
+
|
|
150
|
+
new_options = opts.merge(
|
|
151
|
+
:operation => :"AuthorsApi.list_authors",
|
|
152
|
+
:header_params => header_params,
|
|
153
|
+
:query_params => query_params,
|
|
154
|
+
:form_params => form_params,
|
|
155
|
+
:body => post_body,
|
|
156
|
+
:auth_names => auth_names,
|
|
157
|
+
:return_type => return_type
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug "API called: AuthorsApi#list_authors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
163
|
+
end
|
|
164
|
+
return data, status_code, headers
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
@@ -0,0 +1,176 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Abliteration
|
|
16
|
+
class DatasetsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get one dataset
|
|
23
|
+
# Cost: 1 credit. The passport is null for datasets that do not have one yet.
|
|
24
|
+
# @param id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetDataset200Response]
|
|
27
|
+
def get_dataset(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_dataset_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get one dataset
|
|
33
|
+
# Cost: 1 credit. The passport is null for datasets that do not have one yet.
|
|
34
|
+
# @param id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetDataset200Response, Integer, Hash)>] GetDataset200Response data, response status code and response headers
|
|
37
|
+
def get_dataset_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: DatasetsApi.get_dataset ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DatasetsApi.get_dataset"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/datasets/{id}'.sub('{id}', CGI.escape(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] || 'GetDataset200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"DatasetsApi.get_dataset",
|
|
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: DatasetsApi#get_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List datasets
|
|
86
|
+
# Cost: 5-15 credits, by rows returned.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [String] :category Workflow stage, for example heal or extract.
|
|
89
|
+
# @option opts [String] :author Publisher handle, case-insensitive.
|
|
90
|
+
# @option opts [String] :license License string as published.
|
|
91
|
+
# @option opts [String] :sort Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names. (default to 'downloads')
|
|
92
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
93
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
94
|
+
# @return [ListDatasets200Response]
|
|
95
|
+
def list_datasets(opts = {})
|
|
96
|
+
data, _status_code, _headers = list_datasets_with_http_info(opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# List datasets
|
|
101
|
+
# Cost: 5-15 credits, by rows returned.
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @option opts [String] :category Workflow stage, for example heal or extract.
|
|
104
|
+
# @option opts [String] :author Publisher handle, case-insensitive.
|
|
105
|
+
# @option opts [String] :license License string as published.
|
|
106
|
+
# @option opts [String] :sort Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names. (default to 'downloads')
|
|
107
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
108
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
109
|
+
# @return [Array<(ListDatasets200Response, Integer, Hash)>] ListDatasets200Response data, response status code and response headers
|
|
110
|
+
def list_datasets_with_http_info(opts = {})
|
|
111
|
+
if @api_client.config.debugging
|
|
112
|
+
@api_client.config.logger.debug 'Calling API: DatasetsApi.list_datasets ...'
|
|
113
|
+
end
|
|
114
|
+
allowable_values = ["downloads", "-downloads", "likes", "-likes", "created", "-created", "created_at", "-created_at", "first_seen", "-first_seen", "first_seen_at", "-first_seen_at"]
|
|
115
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
116
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
117
|
+
end
|
|
118
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
119
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DatasetsApi.list_datasets, must be smaller than or equal to 1000.'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
123
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DatasetsApi.list_datasets, must be greater than or equal to 1.'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
127
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DatasetsApi.list_datasets, must be greater than or equal to 0.'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# resource path
|
|
131
|
+
local_var_path = '/api/v1/datasets'
|
|
132
|
+
|
|
133
|
+
# query parameters
|
|
134
|
+
query_params = opts[:query_params] || {}
|
|
135
|
+
query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
|
|
136
|
+
query_params[:'author'] = opts[:'author'] if !opts[:'author'].nil?
|
|
137
|
+
query_params[:'license'] = opts[:'license'] if !opts[:'license'].nil?
|
|
138
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
139
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
140
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
141
|
+
|
|
142
|
+
# header parameters
|
|
143
|
+
header_params = opts[:header_params] || {}
|
|
144
|
+
# HTTP header 'Accept' (if needed)
|
|
145
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
146
|
+
|
|
147
|
+
# form parameters
|
|
148
|
+
form_params = opts[:form_params] || {}
|
|
149
|
+
|
|
150
|
+
# http body (model)
|
|
151
|
+
post_body = opts[:debug_body]
|
|
152
|
+
|
|
153
|
+
# return_type
|
|
154
|
+
return_type = opts[:debug_return_type] || 'ListDatasets200Response'
|
|
155
|
+
|
|
156
|
+
# auth_names
|
|
157
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
158
|
+
|
|
159
|
+
new_options = opts.merge(
|
|
160
|
+
:operation => :"DatasetsApi.list_datasets",
|
|
161
|
+
:header_params => header_params,
|
|
162
|
+
:query_params => query_params,
|
|
163
|
+
:form_params => form_params,
|
|
164
|
+
:body => post_body,
|
|
165
|
+
:auth_names => auth_names,
|
|
166
|
+
:return_type => return_type
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
170
|
+
if @api_client.config.debugging
|
|
171
|
+
@api_client.config.logger.debug "API called: DatasetsApi#list_datasets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
172
|
+
end
|
|
173
|
+
return data, status_code, headers
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -0,0 +1,147 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Abliteration
|
|
16
|
+
class IndicesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# One index with history
|
|
23
|
+
# Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
|
|
24
|
+
# @param id [String] Canonical id or one of the short aliases (DAI, FV, WEAP, F2W). Case-insensitive.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetIndex200Response]
|
|
27
|
+
def get_index(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_index_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# One index with history
|
|
33
|
+
# Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
|
|
34
|
+
# @param id [String] Canonical id or one of the short aliases (DAI, FV, WEAP, F2W). Case-insensitive.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetIndex200Response, Integer, Hash)>] GetIndex200Response data, response status code and response headers
|
|
37
|
+
def get_index_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: IndicesApi.get_index ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IndicesApi.get_index"
|
|
44
|
+
end
|
|
45
|
+
# verify enum value
|
|
46
|
+
allowable_values = ["dai", "DAI", "freedom-velocity", "FV", "freedom_velocity", "weaponization", "WEAP", "f2w-latency", "F2W", "f2w_latency"]
|
|
47
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(id)
|
|
48
|
+
fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
|
|
49
|
+
end
|
|
50
|
+
# resource path
|
|
51
|
+
local_var_path = '/api/v1/indices/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
52
|
+
|
|
53
|
+
# query parameters
|
|
54
|
+
query_params = opts[:query_params] || {}
|
|
55
|
+
|
|
56
|
+
# header parameters
|
|
57
|
+
header_params = opts[:header_params] || {}
|
|
58
|
+
# HTTP header 'Accept' (if needed)
|
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body]
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'GetIndex200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"IndicesApi.get_index",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: IndicesApi#get_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# All four indices
|
|
91
|
+
# Cost: 20 credits. Check the measured flag before treating a value as a finding.
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @return [ListIndices200Response]
|
|
94
|
+
def list_indices(opts = {})
|
|
95
|
+
data, _status_code, _headers = list_indices_with_http_info(opts)
|
|
96
|
+
data
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# All four indices
|
|
100
|
+
# Cost: 20 credits. Check the measured flag before treating a value as a finding.
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @return [Array<(ListIndices200Response, Integer, Hash)>] ListIndices200Response data, response status code and response headers
|
|
103
|
+
def list_indices_with_http_info(opts = {})
|
|
104
|
+
if @api_client.config.debugging
|
|
105
|
+
@api_client.config.logger.debug 'Calling API: IndicesApi.list_indices ...'
|
|
106
|
+
end
|
|
107
|
+
# resource path
|
|
108
|
+
local_var_path = '/api/v1/indices'
|
|
109
|
+
|
|
110
|
+
# query parameters
|
|
111
|
+
query_params = opts[:query_params] || {}
|
|
112
|
+
|
|
113
|
+
# header parameters
|
|
114
|
+
header_params = opts[:header_params] || {}
|
|
115
|
+
# HTTP header 'Accept' (if needed)
|
|
116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
117
|
+
|
|
118
|
+
# form parameters
|
|
119
|
+
form_params = opts[:form_params] || {}
|
|
120
|
+
|
|
121
|
+
# http body (model)
|
|
122
|
+
post_body = opts[:debug_body]
|
|
123
|
+
|
|
124
|
+
# return_type
|
|
125
|
+
return_type = opts[:debug_return_type] || 'ListIndices200Response'
|
|
126
|
+
|
|
127
|
+
# auth_names
|
|
128
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
129
|
+
|
|
130
|
+
new_options = opts.merge(
|
|
131
|
+
:operation => :"IndicesApi.list_indices",
|
|
132
|
+
:header_params => header_params,
|
|
133
|
+
:query_params => query_params,
|
|
134
|
+
:form_params => form_params,
|
|
135
|
+
:body => post_body,
|
|
136
|
+
:auth_names => auth_names,
|
|
137
|
+
:return_type => return_type
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
141
|
+
if @api_client.config.debugging
|
|
142
|
+
@api_client.config.logger.debug "API called: IndicesApi#list_indices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
143
|
+
end
|
|
144
|
+
return data, status_code, headers
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|