dspy 0.24.1 → 0.25.0

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.
data/lib/dspy/predict.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'sorbet-runtime'
4
4
  require_relative 'module'
5
5
  require_relative 'prompt'
6
+ require_relative 'utils/serialization'
6
7
  require_relative 'mixins/struct_builder'
7
8
  require_relative 'mixins/type_coercion'
8
9
  require_relative 'error_formatter'
@@ -165,7 +166,7 @@ module DSPy
165
166
  # Add output to span
166
167
  if span && prediction_result
167
168
  output_hash = prediction_result.respond_to?(:to_h) ? prediction_result.to_h : prediction_result.to_s
168
- span.set_attribute('langfuse.observation.output', output_hash.to_json)
169
+ span.set_attribute('langfuse.observation.output', DSPy::Utils::Serialization.to_json(output_hash))
169
170
  end
170
171
 
171
172
  prediction_result