dspy 0.15.0 → 0.15.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.
- checksums.yaml +4 -4
- data/lib/dspy/code_act.rb +5 -4
- data/lib/dspy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d0e1b54d0ffe7ca9bcb7bde17b9169ee6d716eb8c7add676e6c3ac3dac6e917
|
4
|
+
data.tar.gz: 9b541c527a240a54a8af47aa90cefcadc4618e8787901a1ed75036a227058621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3bb79cd7637b6dfcb1af8d4697e38becd7125c70f5a3dd876efa89742225a56ddf3b82117fa1d8d712e1ccf9d732474c213683530cf8b6c76f96755a21b0adc
|
7
|
+
data.tar.gz: 0bf7b51392457a7f960e611343d24dd0498c2b0cd3b6486c5993c04c9e5327b16f524447028b0d768bb560865bc750d4b5d517ae695b2bc72882483d84fccf94
|
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: "
|
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: "
|
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
|
152
|
+
# Validate input and serialize all fields as task context
|
152
153
|
input_struct = @original_signature_class.input_struct_class.new(**kwargs)
|
153
|
-
task =
|
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