🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
perf: include timestamp on trace retrieval on sessions and datasetrunitemstable (#6549)
Steffen Schmitzc7b09e7843d5
diff --git a/web/src/components/session/index.tsx b/web/src/components/session/index.tsxindex 0d1995c73e..b63672b682 100644--- a/web/src/components/session/index.tsx+++ b/web/src/components/session/index.tsx@@ -259,7 +259,11 @@ export const SessionPage: React.FC<{key={trace.id}><div className="col-span-2 overflow-hidden">- <SessionIO traceId={trace.id} projectId={projectId} />+ <SessionIO+ traceId={trace.id}+ projectId={projectId}+ timestamp={trace.timestamp}+ /></div><div className="-mt-1 p-1 opacity-50 transition-opacity group-hover:opacity-100"><Link@@ -318,12 +322,14 @@ export const SessionPage: React.FC<{const SessionIO = ({traceId,projectId,+ timestamp,}: {traceId: string;projectId: string;+ timestamp: Date;}) => {const trace = api.traces.byId.useQuery(- { traceId, projectId },+ { traceId, projectId, timestamp },{enabled: typeof traceId === "string",trpc: {diff --git a/web/src/features/datasets/components/DatasetRunItemsTable.tsx b/web/src/features/datasets/components/DatasetRunItemsTable.tsxindex b5d0e11bdd..db7d8e3be7 100644--- a/web/src/features/datasets/components/DatasetRunItemsTable.tsx+++ b/web/src/features/datasets/components/DatasetRunItemsTable.tsx@@ -184,12 +184,14 @@ export function DatasetRunItemsTable(enableHiding: true,cell: ({ row }) => {const trace: DatasetRunItemRowData["trace"] = row.getValue("trace");+ const runAt: DatasetRunItemRowData["runAt"] = row.getValue("runAt");return trace ? (<TraceObservationIOCelltraceId={trace.traceId}projectId={props.projectId}observationId={trace.observationId}io="input"+ fromTimestamp={runAt}singleLine={rowHeight === "s"}/>) : null;@@ -203,12 +205,14 @@ export function DatasetRunItemsTable(enableHiding: true,cell: ({ row }) => {const trace: DatasetRunItemRowData["trace"] = row.getValue("trace");+ const runAt: DatasetRunItemRowData["runAt"] = row.getValue("runAt");return trace ? (<TraceObservationIOCelltraceId={trace.traceId}projectId={props.projectId}observationId={trace.observationId}io="output"+ fromTimestamp={runAt}singleLine={rowHeight === "s"}/>) : null;@@ -324,17 +328,24 @@ const TraceObservationIOCell = ({projectId,observationId,io,+ fromTimestamp,singleLine = false,}: {traceId: string;projectId: string;observationId?: string;io: "input" | "output";+ fromTimestamp: Date;singleLine?: boolean;}) => {+ // Subtract 1 day from the fromTimestamp as a buffer in case the trace happened before the run+ const fromTimestampModified = new Date(+ fromTimestamp.getTime() - 24 * 60 * 60 * 1000,+ );+// conditionally fetch the trace or observation depending on the presence of observationIdconst trace = api.traces.byId.useQuery(- { traceId, projectId },+ { traceId, projectId, fromTimestamp: fromTimestampModified },{enabled: observationId === undefined,trpc: {