Skip to content

Commit 78f2229

Browse files
author
Andrei Bratu
committed
leave logOutput as undefined
1 parent 342f0cb commit 78f2229

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/otel/helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ export function isHumanloopSpan(span: ReadableSpan): boolean {
201201
* @param output - Output to be converted
202202
* @returns JSON string representation of the output
203203
*/
204-
export function jsonifyIfNotString(func: Function, output: any): string {
204+
export function jsonifyIfNotString(func: Function, output: any): string | undefined {
205+
if (output === undefined || output === null) {
206+
return undefined;
207+
}
205208
if (typeof output !== "string") {
206209
try {
207210
return JSON.stringify(output);

0 commit comments

Comments
 (0)