venice_client 1.0.14 → 1.0.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13acba6d7c8efb574e011906d2a15a4fcaa31c7efbda1ae3b36a19969a1ff647
4
- data.tar.gz: d750e16c8e81b59fbcb7ce1663de0c605f55f96ec45ab4f868a0bcf40104bc55
3
+ metadata.gz: 0421701eef1e8689b50df9bea77d3958bcfad829f657dfcd8a980fe6ccd0e7f3
4
+ data.tar.gz: cdb020744b9ef71da75b21ffcf8c6900d37831840d023dbe76f6d2f4d1250559
5
5
  SHA512:
6
- metadata.gz: 606f002fb3384e83d6715995aa61642225a4c48dacf1bb05be50be5e25dfd327d63d2d1bcdbfe757006239411dc57adecb82abc9d6cfd346df2fce03a5e9f5a9
7
- data.tar.gz: 3f282a66c4c525674e4251b0b1f77b55e2c074b1b80eb0d61125df4419ac67b87f8a5d82236962d08134a97d909859d78c94e81952482881003c07e7640e8913
6
+ metadata.gz: 2f1aee79ab80ada03e6d6735ab7856f9e1a711a5a0561e70a384ed6015176a1ae42d59ba3e7167b9335ed5fc8878d78e83b540c777c7d887fbfcf50ce16c9759
7
+ data.tar.gz: 3ae1375affa7e6d7d9847af68158595c322938b9cd9f8f8b85beb0335031e10a0de3db4b9ff6205f8f48590adc00f2ee78bc095498b1022afc128e063d23edbb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- venice_client (1.0.14)
4
+ venice_client (1.0.16)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -99,9 +99,9 @@ module VeniceClient
99
99
  # check to see if the attribute exists and convert string to symbol for hash key
100
100
  acceptable_attribute_map = self.class.acceptable_attribute_map
101
101
  attributes = attributes.each_with_object({}) { |(k, v), h|
102
- if (!acceptable_attribute_map.key?(k.to_sym))
103
- fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::AssistantMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
- end
102
+ # if (!acceptable_attribute_map.key?(k.to_sym))
103
+ # fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::AssistantMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ # end
105
105
  h[k.to_sym] = v
106
106
  }
107
107
 
@@ -155,10 +155,10 @@ module VeniceClient
155
155
  # Custom attribute writer method checking allowed values (enum).
156
156
  # @param [Object] role Object to be assigned
157
157
  def role=(role)
158
- validator = EnumAttributeValidator.new('String', ["assistant"])
159
- unless validator.valid?(role)
160
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
161
- end
158
+ # validator = EnumAttributeValidator.new('String', ["assistant"])
159
+ # unless validator.valid?(role)
160
+ # fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
161
+ # end
162
162
  @role = role
163
163
  end
164
164
 
@@ -100,9 +100,9 @@ module VeniceClient
100
100
  # check to see if the attribute exists and convert string to symbol for hash key
101
101
  acceptable_attribute_map = self.class.acceptable_attribute_map
102
102
  attributes = attributes.each_with_object({}) { |(k, v), h|
103
- if (!acceptable_attribute_map.key?(k.to_sym))
104
- fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::CreateChatCompletion200ResponseChoicesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
- end
103
+ # if (!acceptable_attribute_map.key?(k.to_sym))
104
+ # fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::CreateChatCompletion200ResponseChoicesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ # end
106
106
  h[k.to_sym] = v
107
107
  }
108
108
 
@@ -87,7 +87,7 @@ module VeniceClient
87
87
  return model if model
88
88
  else
89
89
  # raise if data contains keys that are not known to the model
90
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ # raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
91
  model = const.build_from_hash(data)
92
92
  return model if model
93
93
  end
@@ -88,9 +88,9 @@ module VeniceClient
88
88
  # check to see if the attribute exists and convert string to symbol for hash key
89
89
  acceptable_attribute_map = self.class.acceptable_attribute_map
90
90
  attributes = attributes.each_with_object({}) { |(k, v), h|
91
- if (!acceptable_attribute_map.key?(k.to_sym))
92
- fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::SystemMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
- end
91
+ # if (!acceptable_attribute_map.key?(k.to_sym))
92
+ # fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::SystemMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ # end
94
94
  h[k.to_sym] = v
95
95
  }
96
96
 
@@ -151,10 +151,10 @@ module VeniceClient
151
151
  # Custom attribute writer method checking allowed values (enum).
152
152
  # @param [Object] role Object to be assigned
153
153
  def role=(role)
154
- validator = EnumAttributeValidator.new('String', ["system"])
155
- unless validator.valid?(role)
156
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
157
- end
154
+ # validator = EnumAttributeValidator.new('String', ["system"])
155
+ # unless validator.valid?(role)
156
+ # fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
157
+ # end
158
158
  @role = role
159
159
  end
160
160
 
@@ -102,9 +102,9 @@ module VeniceClient
102
102
  # check to see if the attribute exists and convert string to symbol for hash key
103
103
  acceptable_attribute_map = self.class.acceptable_attribute_map
104
104
  attributes = attributes.each_with_object({}) { |(k, v), h|
105
- if (!acceptable_attribute_map.key?(k.to_sym))
106
- fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::ToolMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
107
- end
105
+ # if (!acceptable_attribute_map.key?(k.to_sym))
106
+ # fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::ToolMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
107
+ # end
108
108
  h[k.to_sym] = v
109
109
  }
110
110
 
@@ -186,10 +186,10 @@ module VeniceClient
186
186
  # Custom attribute writer method checking allowed values (enum).
187
187
  # @param [Object] role Object to be assigned
188
188
  def role=(role)
189
- validator = EnumAttributeValidator.new('String', ["tool"])
190
- unless validator.valid?(role)
191
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
192
- end
189
+ # validator = EnumAttributeValidator.new('String', ["tool"])
190
+ # unless validator.valid?(role)
191
+ # fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
192
+ # end
193
193
  @role = role
194
194
  end
195
195
 
@@ -84,9 +84,9 @@ module VeniceClient
84
84
  # check to see if the attribute exists and convert string to symbol for hash key
85
85
  acceptable_attribute_map = self.class.acceptable_attribute_map
86
86
  attributes = attributes.each_with_object({}) { |(k, v), h|
87
- if (!acceptable_attribute_map.key?(k.to_sym))
88
- fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::UserMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
- end
87
+ # if (!acceptable_attribute_map.key?(k.to_sym))
88
+ # fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::UserMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ # end
90
90
  h[k.to_sym] = v
91
91
  }
92
92
 
@@ -143,10 +143,10 @@ module VeniceClient
143
143
  # Custom attribute writer method checking allowed values (enum).
144
144
  # @param [Object] role Object to be assigned
145
145
  def role=(role)
146
- validator = EnumAttributeValidator.new('String', ["user"])
147
- unless validator.valid?(role)
148
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
149
- end
146
+ # validator = EnumAttributeValidator.new('String', ["user"])
147
+ # unless validator.valid?(role)
148
+ # fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
149
+ # end
150
150
  @role = role
151
151
  end
152
152
 
@@ -11,5 +11,5 @@ Generator version: 7.14.0
11
11
  =end
12
12
 
13
13
  module VeniceClient
14
- VERSION = '1.0.14'
14
+ VERSION = '1.0.16'
15
15
  end
@@ -19,6 +19,11 @@ require 'json'
19
19
  describe 'ChatApi' do
20
20
  before do
21
21
  # run before each test
22
+ VeniceClient.configure do |config|
23
+ # Configure Bearer authorization: BearerAuth
24
+ config.access_token = ENV['VENICE_API_KEY'] || 'YOUR_API_KEY'
25
+ config.debugging = true
26
+ end
22
27
  @api_instance = VeniceClient::ChatApi.new
23
28
  end
24
29
 
@@ -40,8 +45,32 @@ describe 'ChatApi' do
40
45
  # @option opts [ChatCompletionRequest] :chat_completion_request
41
46
  # @return [CreateChatCompletion200Response]
42
47
  describe 'create_chat_completion test' do
43
- it 'should work' do
44
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
48
+ it 'should work with venice-uncensored model' do
49
+ # Create a user message
50
+ user_message = VeniceClient::UserMessage.new(
51
+ role: 'user',
52
+ content: 'Hello, world!'
53
+ )
54
+
55
+ # Create the chat completion request
56
+ chat_completion_request = VeniceClient::ChatCompletionRequest.new(
57
+ model: 'venice-uncensored',
58
+ messages: [user_message],
59
+ parallel_tool_calls: false
60
+ )
61
+
62
+ begin
63
+ # Make the API call
64
+ result = @api_instance.create_chat_completion(chat_completion_request: chat_completion_request)
65
+
66
+ # Add assertions
67
+ expect(result).to be_instance_of(VeniceClient::CreateChatCompletion200Response)
68
+ expect(result.choices).not_to be_empty
69
+ rescue VeniceClient::ApiError => e
70
+ puts "API Error: #{e.message}"
71
+ puts "Response body: #{e.response_body}"
72
+ fail e
73
+ end
45
74
  end
46
75
  end
47
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: venice_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator