Skip to content

Commit

Permalink
Merge branch 'main' into fix/filters
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Jul 16, 2024
2 parents 1d682f0 + 966c333 commit 319be03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/backend/src/api/v1/runs/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function registerRunEvent(
type,
userId,
templateId,
templateVersionId,
userProps,
event: eventName,
runId,
Expand All @@ -47,8 +48,9 @@ async function registerRunEvent(
tags = metadata?.tags
}

if (!templateId) {
templateId = metadata?.templateId
if (!templateVersionId) {
templateVersionId =
templateId || metadata?.templateId || metadata?.templateVersionId
}

let parentRunIdToUse = parentRunId
Expand Down Expand Up @@ -122,7 +124,7 @@ async function registerRunEvent(
status: "started",
params: params || extra,
metadata,
templateVersionId: templateId,
templateVersionId,
parentRunId: parentRunIdToUse,
input,
runtime,
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/utils/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export interface Event {
message?: string | any // deprecated (for logs)
extra?: any
feedback?: any
templateId?: string
templateId?: string // deprecated, use templateVersionId
templateVersionId?: string
metadata?: any
tokensUsage?: {
prompt: number
Expand Down

0 comments on commit 319be03

Please sign in to comment.