We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 342f0cb commit 78f2229Copy full SHA for 78f2229
src/otel/helpers.ts
@@ -201,7 +201,10 @@ export function isHumanloopSpan(span: ReadableSpan): boolean {
201
* @param output - Output to be converted
202
* @returns JSON string representation of the output
203
*/
204
-export function jsonifyIfNotString(func: Function, output: any): string {
+export function jsonifyIfNotString(func: Function, output: any): string | undefined {
205
+ if (output === undefined || output === null) {
206
+ return undefined;
207
+ }
208
if (typeof output !== "string") {
209
try {
210
return JSON.stringify(output);
0 commit comments