Skip to content

Commit

Permalink
fix async prompt logging
Browse files Browse the repository at this point in the history
  • Loading branch information
colegottdank committed Sep 20, 2024
1 parent dd3167b commit 89079c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion worker/src/lib/dbLogger/DBLoggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,18 @@ export async function dbLoggableRequestFromAsyncLogModel(
return new DBLoggable({
request: {
requestId: providerRequestHeaders.requestId ?? crypto.randomUUID(),
promptSettings: requestWrapper.promptSettings,
promptSettings: providerRequestHeaders.promptHeaders.promptId
? {
promptId: providerRequestHeaders.promptHeaders.promptId,
promptVersion:
providerRequestHeaders.promptHeaders.promptVersion ?? "",
promptMode: "production",
}
: {
promptId: undefined,
promptVersion: "",
promptMode: "deactivated",
},
userId: providerRequestHeaders.userId ?? undefined,
startTime: new Date(
asyncLogModel.timing.startTime.seconds * 1000 +
Expand Down

0 comments on commit 89079c2

Please sign in to comment.