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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 264ea2bbc31ea7eb1c44aede57d37a613aeb2defab8cfffab368511acd6b1a4c
|
|
4
|
+
data.tar.gz: 61c42b0e6b7fb48c7512cb072922b695e488df69bb9aa434498708ece872ba7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
|
@@ -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.)\\
|