abliteration 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/docs/DeletionSummary.md +28 -0
  4. data/docs/DeletionSummaryTimelineInner.md +20 -0
  5. data/docs/DeletionSummaryTopByDownloadsInner.md +24 -0
  6. data/docs/DelistedModel.md +30 -0
  7. data/docs/GetHistoricalDeletionSummary200Response.md +32 -0
  8. data/docs/HistoricalDeletion.md +28 -0
  9. data/docs/ListDelistedModels200Response.md +32 -0
  10. data/docs/ListHistoricalDeletions200Response.md +32 -0
  11. data/docs/ModelDetail.md +4 -0
  12. data/docs/ModelSummary.md +5 -1
  13. data/docs/ModelsApi.md +229 -2
  14. data/lib/abliteration/api/models_api.rb +245 -4
  15. data/lib/abliteration/models/deletion_summary.rb +202 -0
  16. data/lib/abliteration/models/deletion_summary_timeline_inner.rb +156 -0
  17. data/lib/abliteration/models/deletion_summary_top_by_downloads_inner.rb +174 -0
  18. data/lib/abliteration/models/delisted_model.rb +206 -0
  19. data/lib/abliteration/models/get_historical_deletion_summary200_response.rb +384 -0
  20. data/lib/abliteration/models/historical_deletion.rb +197 -0
  21. data/lib/abliteration/models/list_delisted_models200_response.rb +386 -0
  22. data/lib/abliteration/models/list_historical_deletions200_response.rb +386 -0
  23. data/lib/abliteration/models/model_detail.rb +23 -1
  24. data/lib/abliteration/models/model_summary.rb +27 -5
  25. data/lib/abliteration/version.rb +1 -1
  26. data/lib/abliteration.rb +8 -0
  27. data/spec/models/deletion_summary_spec.rb +66 -0
  28. data/spec/models/deletion_summary_timeline_inner_spec.rb +42 -0
  29. data/spec/models/deletion_summary_top_by_downloads_inner_spec.rb +54 -0
  30. data/spec/models/delisted_model_spec.rb +72 -0
  31. data/spec/models/get_historical_deletion_summary200_response_spec.rb +82 -0
  32. data/spec/models/historical_deletion_spec.rb +66 -0
  33. data/spec/models/list_delisted_models200_response_spec.rb +82 -0
  34. data/spec/models/list_historical_deletions200_response_spec.rb +82 -0
  35. metadata +34 -2
@@ -0,0 +1,174 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ class DeletionSummaryTopByDownloadsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :peak_downloads
21
+
22
+ attr_accessor :last_seen_month
23
+
24
+ attr_accessor :months_alive
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'peak_downloads' => :'peak_downloads',
31
+ :'last_seen_month' => :'last_seen_month',
32
+ :'months_alive' => :'months_alive'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'peak_downloads' => :'Integer',
51
+ :'last_seen_month' => :'String',
52
+ :'months_alive' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DeletionSummaryTopByDownloadsInner` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DeletionSummaryTopByDownloadsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'peak_downloads')
83
+ self.peak_downloads = attributes[:'peak_downloads']
84
+ end
85
+
86
+ if attributes.key?(:'last_seen_month')
87
+ self.last_seen_month = attributes[:'last_seen_month']
88
+ end
89
+
90
+ if attributes.key?(:'months_alive')
91
+ self.months_alive = attributes[:'months_alive']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ id == o.id &&
116
+ peak_downloads == o.peak_downloads &&
117
+ last_seen_month == o.last_seen_month &&
118
+ months_alive == o.months_alive
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [id, peak_downloads, last_seen_month, months_alive].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ class DelistedModel < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :author
21
+
22
+ attr_accessor :family
23
+
24
+ attr_accessor :params_b
25
+
26
+ # Downloads at the moment the model was last visible on HF. Not a live counter.
27
+ attr_accessor :downloads
28
+
29
+ # ISO-8601 timestamp of the last successful Hub observation. Approximately when the model died.
30
+ attr_accessor :last_seen_at
31
+
32
+ # Whole days between last_seen_at and now, computed server-side for convenience.
33
+ attr_accessor :days_since_gone
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'author' => :'author',
40
+ :'family' => :'family',
41
+ :'params_b' => :'params_b',
42
+ :'downloads' => :'downloads',
43
+ :'last_seen_at' => :'last_seen_at',
44
+ :'days_since_gone' => :'days_since_gone'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'id' => :'String',
62
+ :'author' => :'String',
63
+ :'family' => :'String',
64
+ :'params_b' => :'Float',
65
+ :'downloads' => :'Integer',
66
+ :'last_seen_at' => :'String',
67
+ :'days_since_gone' => :'Integer'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'family',
75
+ :'params_b',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DelistedModel` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DelistedModel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.key?(:'author')
100
+ self.author = attributes[:'author']
101
+ end
102
+
103
+ if attributes.key?(:'family')
104
+ self.family = attributes[:'family']
105
+ end
106
+
107
+ if attributes.key?(:'params_b')
108
+ self.params_b = attributes[:'params_b']
109
+ end
110
+
111
+ if attributes.key?(:'downloads')
112
+ self.downloads = attributes[:'downloads']
113
+ end
114
+
115
+ if attributes.key?(:'last_seen_at')
116
+ self.last_seen_at = attributes[:'last_seen_at']
117
+ end
118
+
119
+ if attributes.key?(:'days_since_gone')
120
+ self.days_since_gone = attributes[:'days_since_gone']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ id == o.id &&
145
+ author == o.author &&
146
+ family == o.family &&
147
+ params_b == o.params_b &&
148
+ downloads == o.downloads &&
149
+ last_seen_at == o.last_seen_at &&
150
+ days_since_gone == o.days_since_gone
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [id, author, family, params_b, downloads, last_seen_at, days_since_gone].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end