abliteration 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +9 -0
- data/README.md +55 -7
- data/Rakefile +10 -0
- data/abliteration.gemspec +38 -21
- data/docs/Author.md +26 -0
- data/docs/AuthorDetail.md +28 -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 +184 -0
- data/lib/abliteration/models/author_detail.rb +201 -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 +196 -16
|
@@ -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 (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 (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", "total_models", "-total_models"]
|
|
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 (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 (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", "created_at", "-created_at", "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]
|
|
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]
|
|
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", "freedom-velocity", "weaponization", "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
|
|
@@ -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 MethodsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get one method
|
|
23
|
+
# Cost: 1 credit.
|
|
24
|
+
# @param id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetMethod200Response]
|
|
27
|
+
def get_method(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_method_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get one method
|
|
33
|
+
# Cost: 1 credit.
|
|
34
|
+
# @param id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetMethod200Response, Integer, Hash)>] GetMethod200Response data, response status code and response headers
|
|
37
|
+
def get_method_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: MethodsApi.get_method ...'
|
|
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 MethodsApi.get_method"
|
|
44
|
+
end
|
|
45
|
+
# verify enum value
|
|
46
|
+
allowable_values = ["M1", "M2", "M3", "M4", "M5", "M5-frankenstein", "M6", "M7", "M8", "M-uncensored", "unknown"]
|
|
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/methods/{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] || 'GetMethod200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"MethodsApi.get_method",
|
|
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: MethodsApi#get_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List the method taxonomy
|
|
91
|
+
# Cost: 5-15 credits. Every code is returned, including ones with no models.
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @return [ListMethods200Response]
|
|
94
|
+
def list_methods(opts = {})
|
|
95
|
+
data, _status_code, _headers = list_methods_with_http_info(opts)
|
|
96
|
+
data
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List the method taxonomy
|
|
100
|
+
# Cost: 5-15 credits. Every code is returned, including ones with no models.
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @return [Array<(ListMethods200Response, Integer, Hash)>] ListMethods200Response data, response status code and response headers
|
|
103
|
+
def list_methods_with_http_info(opts = {})
|
|
104
|
+
if @api_client.config.debugging
|
|
105
|
+
@api_client.config.logger.debug 'Calling API: MethodsApi.list_methods ...'
|
|
106
|
+
end
|
|
107
|
+
# resource path
|
|
108
|
+
local_var_path = '/api/v1/methods'
|
|
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] || 'ListMethods200Response'
|
|
126
|
+
|
|
127
|
+
# auth_names
|
|
128
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
129
|
+
|
|
130
|
+
new_options = opts.merge(
|
|
131
|
+
:operation => :"MethodsApi.list_methods",
|
|
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: MethodsApi#list_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
143
|
+
end
|
|
144
|
+
return data, status_code, headers
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|