zuno 1.1.1 → 1.1.2

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/lib/zuno/version.rb +1 -1
  4. data/lib/zuno.rb +11 -23
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7d6ca01a3009551afda766233cc241c30eff87eb7226142552c21f9d68450d0
4
- data.tar.gz: f71bd9073d2d14829502216a82e28d4f11e4bbb1de0b9f330befb4d2a6d02757
3
+ metadata.gz: 3e675bc01e1dd129fc934977e8dc4f9b339e68138001e752745d5cfa047f5f52
4
+ data.tar.gz: ce34957f81e60c54e092958e912aec67cc22463e8e288f8b1cf1926aec3a5357
5
5
  SHA512:
6
- metadata.gz: 2228bcd4b752897c4757ad869fbe92ad0c189cc24be1d265d718f80e2cc23104194c737658022b0caa35c25f98d4a94006ba19746f1b30c6fd56317d6d3cee36
7
- data.tar.gz: a24da98ad4c6ce0214e26224d6e8f65886901865df8e1c05ab1f0572028c2d7f797328388bfdf035e7cfb52ecc52c9e5e207e101165e478df517589a0505ae81
6
+ metadata.gz: b2a15a7d459741e5390436aa1c6d52cd2d4eb2181fb28192df141a524546857983daca479ac0a42b4ff649c07b56e2fc590dee8964d9c7cbb660b98e74053511
7
+ data.tar.gz: 65af2937a76208ab478df9c05baa9a716b763ecffe2751ed0f4a6aece5b3dce0a2e0c9e260636f774d0305612cbb7f28626e9073c1c4989a004fe2a01a66e378
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.2](https://github.com/dqnamo/zuno/compare/v1.1.1...v1.1.2) (2026-04-06)
4
+
5
+ ### Bug Fixes
6
+
7
+ * preserve structured assistant content for tool-call turns so provider-specific metadata survives loop history replay
8
+
3
9
  ## [1.1.1](https://github.com/dqnamo/zuno/compare/v1.1.0...v1.1.1) (2026-04-06)
4
10
 
5
11
  ### Bug Fixes
data/lib/zuno/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zuno
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
data/lib/zuno.rb CHANGED
@@ -1118,12 +1118,6 @@ module Zuno
1118
1118
  payload["max_tokens"] = max_tokens unless max_tokens.nil?
1119
1119
  payload["tools"] = tools.values.map(&:as_provider_tool) unless tools.empty?
1120
1120
  payload["tool_choice"] = deep_stringify(tool_choice) unless tool_choice.nil?
1121
- payload["parallel_tool_calls"] = false if disable_parallel_tool_calls_by_default?(
1122
- model_id: model_id,
1123
- provider: provider,
1124
- tools: tools,
1125
- provider_options: provider_options
1126
- )
1127
1121
 
1128
1122
  request_options = reject_keys(provider_options, provider_adapter_config_keys(provider) + [ :tool_choice ])
1129
1123
  payload.merge!(deep_stringify(request_options)) if request_options.is_a?(Hash)
@@ -1131,22 +1125,6 @@ module Zuno
1131
1125
  end
1132
1126
  private_class_method :build_payload
1133
1127
 
1134
- def disable_parallel_tool_calls_by_default?(model_id:, provider:, tools:, provider_options:)
1135
- return false if tools.empty?
1136
- return false unless provider.to_sym == :ai_gateway
1137
- return false unless gemini_model?(model_id)
1138
- return false if provider_options&.key?(:parallel_tool_calls) || provider_options&.key?("parallel_tool_calls")
1139
-
1140
- true
1141
- end
1142
- private_class_method :disable_parallel_tool_calls_by_default?
1143
-
1144
- def gemini_model?(model_id)
1145
- normalized = model_id.to_s.downcase
1146
- normalized.start_with?("google/") || normalized.include?("gemini")
1147
- end
1148
- private_class_method :gemini_model?
1149
-
1150
1128
  def provider_adapter_config_keys(provider)
1151
1129
  case provider.to_sym
1152
1130
  when :openrouter
@@ -1195,12 +1173,22 @@ module Zuno
1195
1173
  def build_assistant_tool_call_message(message:, tool_calls:)
1196
1174
  {
1197
1175
  "role" => "assistant",
1198
- "content" => extract_message_text(message),
1176
+ "content" => normalize_message_content_for_history(message["content"]),
1199
1177
  "tool_calls" => tool_calls
1200
1178
  }
1201
1179
  end
1202
1180
  private_class_method :build_assistant_tool_call_message
1203
1181
 
1182
+ def normalize_message_content_for_history(content)
1183
+ case content
1184
+ when Array, Hash
1185
+ deep_stringify(content)
1186
+ else
1187
+ content
1188
+ end
1189
+ end
1190
+ private_class_method :normalize_message_content_for_history
1191
+
1204
1192
  def execute_tool_call(tool_call:, tools:, tool_call_id: nil, arguments: nil)
1205
1193
  tool_name = tool_call.dig("function", "name").to_s
1206
1194
  tool_call_id = normalize_tool_call_id(tool_call_id || tool_call["id"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hyperaide