dspy 0.15.0 → 0.15.1

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: 0df0301fbda6076f6d4ecaeb7fa907982b11fe67521d4aa689ca812cb1485a71
4
- data.tar.gz: ba7d57fa4fef32861b37ccb428c12f58c4262123bff1069dddb3c53c72e9dd67
3
+ metadata.gz: 2f0a8e9dc70e65ef655829a080bc1a7a44cbcf5927c4903c42881c72c8796060
4
+ data.tar.gz: 39195cb9177617a61e21aae7ed7cedaed536f6862f5840bef3a09b3ade9966d0
5
5
  SHA512:
6
- metadata.gz: 07a619845a4e65cb03d4b9e53726bb6b306ddb5d5c08a6521785c415d6f4a5e1a21949f5120c2dafc3429114c5b97c0a1f2d19d30528bfcfe311aef97bc28245
7
- data.tar.gz: 90a800ee9a612da5fd735b36b3c887df8fc777ccd0ed5b4badf4049352c19bcb64a508e7b722b4eae51b08ddf5386e292ae7bbc893c1b444ee1e3b1305f46f05
6
+ metadata.gz: 8b0f2378f818914e4752f1ba309f79c9abfca9a34d5223f55cebc384023f8b76586f36eef725dc170f197c88669df9ab1b3c742dd2a13d2afd65759753066ec2
7
+ data.tar.gz: 9039f598229486c785d4b254d0d0e0101b312e2975e4e56dbef52c5b7eb99fa29eba74c661fedfabac39688fa59a20fe64823777f39a87b32f55aa546b4ecfa6
data/lib/dspy/code_act.rb CHANGED
@@ -9,6 +9,7 @@ require 'stringio'
9
9
  require_relative 'instrumentation'
10
10
  require_relative 'mixins/struct_builder'
11
11
  require_relative 'mixins/instrumentation_helpers'
12
+ require_relative 'type_serializer'
12
13
 
13
14
  module DSPy
14
15
  # Define a simple struct for CodeAct history entries with proper type annotations
@@ -37,7 +38,7 @@ module DSPy
37
38
 
38
39
  input do
39
40
  const :task, String,
40
- description: "The task description requiring Ruby code solution"
41
+ description: "JSON representation of all input fields for the task"
41
42
  const :context, String,
42
43
  description: "Available variables and previous results from code execution history"
43
44
  const :history, T::Array[CodeActHistoryEntry],
@@ -67,7 +68,7 @@ module DSPy
67
68
 
68
69
  input do
69
70
  const :task, String,
70
- description: "The original task"
71
+ description: "JSON representation of all input fields for the task"
71
72
  const :history, T::Array[CodeActHistoryEntry],
72
73
  description: "Previous thoughts, code executions, and their results"
73
74
  const :execution_result, T.nilable(String),
@@ -148,9 +149,9 @@ module DSPy
148
149
  result = instrument_prediction('dspy.codeact', @original_signature_class, kwargs, {
149
150
  max_iterations: @max_iterations
150
151
  }) do
151
- # Validate input and extract task
152
+ # Validate input and serialize all fields as task context
152
153
  input_struct = @original_signature_class.input_struct_class.new(**kwargs)
153
- task = T.cast(input_struct.serialize.values.first, String)
154
+ task = DSPy::TypeSerializer.serialize(input_struct).to_json
154
155
 
155
156
  # Execute CodeAct reasoning loop
156
157
  reasoning_result = execute_codeact_reasoning_loop(task)
data/lib/dspy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSPy
4
- VERSION = "0.15.0"
4
+ VERSION = "0.15.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dspy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vicente Reig Rincón de Arellano