Skip to content

Commit f5a75e5

Browse files
unwrap pyodide object correctly (#8466)
1 parent cfc54bd commit f5a75e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dspy/primitives/runner.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ sys.stderr = old_stderr
147147
// output += capturedStderr;
148148
} else {
149149
// If the code returned a real value, just return that
150-
output = result;
150+
try {
151+
output = result.toJs();
152+
} catch (e) {
153+
output = result;
154+
}
151155
}
152156

153157
console.log(JSON.stringify({ output }));

0 commit comments

Comments
 (0)