Skip to content

Commit

Permalink
[OPIK-536]: improve code readability;
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha committed Dec 13, 2024
1 parent 02bc347 commit 32faa60
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apps/opik-frontend/src/api/playground/useOpenApiRunStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ const useOpenApiRunStreaming = ({
}
}
}

return {
startTime,
endTime: dayjs().utc().toISOString(),
result: accumulatedValue,
error: null,
usage,
choices,
};
// abort signal also jumps into here
} catch (error) {
return {
Expand All @@ -179,15 +188,6 @@ const useOpenApiRunStreaming = ({
} finally {
onLoading(false);
}

return {
startTime,
endTime: dayjs().utc().toISOString(),
result: accumulatedValue,
error: null,
usage,
choices,
};
}, [messages, model, onAddChunk, onError, onLoading, configs]);

return { runStreaming, stop };
Expand Down

0 comments on commit 32faa60

Please sign in to comment.