venice_client 1.0.24 → 1.0.25

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: 8fbd0305b86caa9b439291353fae4284c9ceed700bdfa60d291c8b0ebbe6fa0a
4
- data.tar.gz: 5021046a1a57564554191b155f93bb97eaea9bdffbe255cbd856826d9a5647a9
3
+ metadata.gz: 264ea2bbc31ea7eb1c44aede57d37a613aeb2defab8cfffab368511acd6b1a4c
4
+ data.tar.gz: 61c42b0e6b7fb48c7512cb072922b695e488df69bb9aa434498708ece872ba7c
5
5
  SHA512:
6
- metadata.gz: 868fbb00dc8fb936514df04fe26bcd7df2699371432b8a78d43ead4b23c112e2f65cb4ae4c2f7fd50f34f425c15e9d6a1c95546bd73a021c0310f91b4767cfd9
7
- data.tar.gz: 11dc3e92dd45eb1ca74218876a8b898b01a0ba90d509035d6e19125225b3047e1b054a5ec8b09ce66d15db479293a78be43fb6382372664f312313c558521163
6
+ metadata.gz: 10426c948343fc2c899b33d8866b5a6147bf68374a1a26fef4c20ebcb07ef558eda8fe84e6902481a2121dd99dbda8c4bec3416b3a89dbaaf9eb54e43acdb270
7
+ data.tar.gz: c68b8a8396027e85a6b5b71e4a7fe9bc8f2e960db3f44a19d3ddd271ba6dbd0fdf0347950a17a5fcb19b0f94012c06034a371e3829ced4395f77e625d06d739d
@@ -87,7 +87,9 @@ 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
+ if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash)
91
+ data = data.select { |k, _v| const.acceptable_attributes.include?(k) }
92
+ end
91
93
  model = const.build_from_hash(data)
92
94
  return model if model
93
95
  end
@@ -11,5 +11,5 @@ Generator version: 7.14.0
11
11
  =end
12
12
 
13
13
  module VeniceClient
14
- VERSION = '1.0.24'
14
+ VERSION = '1.0.25'
15
15
  end
@@ -18,4 +18,21 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe VeniceClient::CreateChatCompletion200ResponseChoicesInnerMessage do
21
+ it 'builds an AssistantMessage even when payload includes unknown keys' do
22
+ payload = {
23
+ role: 'assistant',
24
+ content: 'hello',
25
+ refusal: nil,
26
+ annotations: nil,
27
+ audio: nil,
28
+ function_call: nil,
29
+ tool_calls: [],
30
+ reasoning: 'extra server field not in schema'
31
+ }
32
+
33
+ message = described_class.build(payload)
34
+ expect(message).to be_a(VeniceClient::AssistantMessage)
35
+ expect(message.role).to eq('assistant')
36
+ expect(message.content).to eq('hello')
37
+ end
21
38
  end
data/update.sh CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ set -e
4
+
3
5
  # Preserve version
4
6
  VERSION=$(grep -o "'.*'" lib/venice_client/version.rb | tr -d "'")
5
7
 
@@ -21,6 +23,14 @@ s/self.enable_web_search = 'false'/self.enable_web_search = 'off'/g
21
23
  s/\["stop", "length"\]/\["stop", "length", "tool_calls"\]/g
22
24
  SED_SCRIPT
23
25
 
26
+ sed -i "/raise if const.respond_to?(:acceptable_attributes)/c\
27
+ if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash)\\
28
+ data = data.select { |k, _v| const.acceptable_attributes.include?(k) }\\
29
+ end" lib/venice_client/models/create_chat_completion200_response_choices_inner_message.rb
30
+
31
+ grep -q "data = data.select { |k, _v| const.acceptable_attributes.include?(k) }" \
32
+ lib/venice_client/models/create_chat_completion200_response_choices_inner_message.rb
33
+
24
34
  # Fix binary content type handling in api_client.rb (video/mp4, audio/*, etc.)
25
35
  sed -i "/fail \"Content-Type is not supported/i\\
26
36
  # Return raw body for binary content types (video, audio, etc.)\\
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.24
4
+ version: 1.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator