handleSelectTrace(trace)} className={styles.traceTitle}>
{trace.run_type.toUpperCase()}
diff --git a/ui/src/components/TraceTree/traceTree.module.scss b/ui/src/components/TraceTree/traceTree.module.scss
index 9ee1e1e..8987df8 100644
--- a/ui/src/components/TraceTree/traceTree.module.scss
+++ b/ui/src/components/TraceTree/traceTree.module.scss
@@ -2,16 +2,18 @@
.traceTree {
width: 30%;
- padding-right: 16px;
- border-right: c.$border-width solid #ddd;
+ padding: 0 16px;
height: calc(100vh - #{c.$breadcrumb-height} - 34px);
+ background-color: c.$panel-background-color;
+ border-radius: c.$panel-radius;
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.2);
}
.runTypeBox {
font-size: 12px;
color: #666;
display: inline-block;
- border: c.$border-width solid c.$border-color;
+ border: c.$border-width solid c.$border-color-transparent;
border-radius: c.$border-radius;
padding: 2px 4px;
margin-right: 8px;
@@ -62,7 +64,7 @@
.traceChildren {
margin-left: 8px;
- border-left: 2px solid #ddd;
+ border-left: 2px solid c.$border-color-bold;
padding-left: 10px;
}
@@ -74,5 +76,5 @@
.active {
border-radius: c.$border-radius;
- border: c.$border-width solid #333333;
+ border: c.$border-width * 2 solid c.$border-color-bold;
}
diff --git a/ui/src/models/trace_detail_response.ts b/ui/src/models/trace_detail_response.ts
index 3a4ff8e..f470bf9 100644
--- a/ui/src/models/trace_detail_response.ts
+++ b/ui/src/models/trace_detail_response.ts
@@ -5,6 +5,7 @@ export interface TraceTreeNode {
end_time: string;
outputs: { [key: string]: any };
inputs: { [key: string]: any };
+ error: string | null
session_name: string;
run_type: string;
latency: number;
@@ -12,4 +13,5 @@ export interface TraceTreeNode {
children: TraceTreeNode[];
execution_order?: number;
depth?: number;
+ feedback?: { [key: string]: any }; //TODO Make this a proper type
}
diff --git a/ui/src/models/tree/trace_detail_response_tree.ts b/ui/src/models/tree/trace_detail_response_tree.ts
index 8ce0ed4..1f9d547 100644
--- a/ui/src/models/tree/trace_detail_response_tree.ts
+++ b/ui/src/models/tree/trace_detail_response_tree.ts
@@ -1,6 +1,7 @@
export interface TraceDetailResponseParent {
run_id: string;
name: string;
+ error: string | null;
start_time: string;
end_time: string;
execution_order: number;
@@ -17,6 +18,7 @@ export interface TraceDetailResponseChild {
depth: number;
run_id: string;
execution_order: number;
+ error: string | null;
name: string;
start_time: string;
end_time: string;
diff --git a/ui/src/pages/Home.module.scss b/ui/src/pages/Home.module.scss
index 8ff142e..f8ac9d5 100644
--- a/ui/src/pages/Home.module.scss
+++ b/ui/src/pages/Home.module.scss
@@ -8,6 +8,18 @@
height: 100vh;
}
+.homePanel {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ width: 50%;
+ padding: 32px;
+ border-radius: c.$panel-radius;
+ background-color: c.$panel-background-color;
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.2);
+}
+
.button {
display: flex;
align-items: center;
@@ -15,7 +27,8 @@
padding: 8px;
margin-top: 32px;
border-radius: c.$border-radius;
- border: c.$border-width solid c.$border-color;
+ border: c.$border-width * 2 solid c.$border-color-bold;
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.2);
background-color: transparent;
cursor: pointer;
color: c.$primary-color;
diff --git a/ui/src/pages/index.tsx b/ui/src/pages/index.tsx
index 4c6ed3a..5106aae 100644
--- a/ui/src/pages/index.tsx
+++ b/ui/src/pages/index.tsx
@@ -5,12 +5,14 @@ import {Hierarchy} from "iconic-react";
const Home = () => {
return (
+
LangTrace
View your Langchain data
Traces
+
);
};
diff --git a/ui/src/pages/traces/Traces.module.scss b/ui/src/pages/traces/Traces.module.scss
index 00e131c..2913a1b 100644
--- a/ui/src/pages/traces/Traces.module.scss
+++ b/ui/src/pages/traces/Traces.module.scss
@@ -29,22 +29,26 @@
@extend .chip;
background-color: c.$temperature-1;
color: c.$temperature-1-text;
+ border: 1px solid c.$temperature-1-text;
}
.inprogress {
@extend .chip;
background-color: c.$temperature-2;
color: c.$temperature-2-text;
+ border: 1px solid c.$temperature-2-text;
}
.warning {
@extend .chip;
background-color: c.$temperature-3;
color: c.$temperature-3-text;
+ border: 1px solid c.$temperature-3-text;
}
.error {
@extend .chip;
background-color: c.$temperature-4;
color: c.$temperature-4-text;
+ border: 1px solid c.$temperature-4-text;
}
.columnIcon {
diff --git a/ui/src/pages/traces/index.tsx b/ui/src/pages/traces/index.tsx
index 99d12e6..b1475cc 100644
--- a/ui/src/pages/traces/index.tsx
+++ b/ui/src/pages/traces/index.tsx
@@ -10,27 +10,19 @@ import {
import { IconType } from 'react-icons/lib';
import { useRouter } from 'next/router';
import { GetServerSidePropsContext } from 'next';
-import FilterPanel from '@/components/FilterPanel';
+import StatsPanel from '@/components/FilterPanel';
import TraceTable from '../../components/TraceTable';
import { TracePercentile } from '@/models/traces_response';
import LatencyChip from '@/components/LatencyChip';
+import { TraceTreeNode } from '@/models/trace_detail_response';
const breadcrumbItems = [
{ name: 'Home', path: '/' },
{ name: 'Traces', path: undefined },
];
-interface Trace {
- run_id: string;
- name: string;
- error?: string;
- start_time: string;
- end_time?: string;
- latency: number;
-}
-
interface TracesProps {
- traces: Trace[];
+ traces: TraceTreeNode[];
latencyPercentiles: TracePercentile[];
}
@@ -62,7 +54,7 @@ const handleRowClick = (run_id: string) => {
window.location.href = `/traces/${run_id}`;
};
-function getStatusForTrace(trace: Trace): ReactElement
{
+function getStatusForTrace(trace: TraceTreeNode): ReactElement {
if (trace.error) {
return
;
} else if (trace.end_time) {
@@ -134,18 +126,17 @@ const Traces: React.FC = ({ traces, latencyPercentiles }) => {
{
const runDate = convertToDateTime(trace.start_time);
- return (
- handleRowClick(trace.run_id)}
- className={styles.clickableRow}>
- {trace.run_id} |
- {getStatusForTrace(trace)} |
- {trace.name} |
- {runDate.date} @ {runDate.time} |
- |
-
- );
+ return handleRowClick(trace.run_id)}
+ className={styles.clickableRow}>
+ {trace.run_id} |
+ {getStatusForTrace(trace)} |
+ {trace.name} |
+ {runDate.date} @ {runDate.time} |
+ |
+ { trace.feedback?.key ? trace.feedback?.key + ": " + trace.feedback?.score : ''} |
+
;
})}/>
-
+
);
diff --git a/ui/src/pages/traces/traceDetailsPage.module.scss b/ui/src/pages/traces/traceDetailsPage.module.scss
index 601b27e..4e4e7e5 100644
--- a/ui/src/pages/traces/traceDetailsPage.module.scss
+++ b/ui/src/pages/traces/traceDetailsPage.module.scss
@@ -1,6 +1,9 @@
+@use '../../styles/constants' as c;
+
+
.traceDetailsContainer {
display: flex;
- gap: 0;
+ gap: 16px;
}
@media (max-width: 768px) {
diff --git a/ui/src/styles/constants.scss b/ui/src/styles/constants.scss
index b324201..d7a22ab 100644
--- a/ui/src/styles/constants.scss
+++ b/ui/src/styles/constants.scss
@@ -1,12 +1,15 @@
$black: #000;
$white: #fff;
-$background-color: $white;
+$background-color: #eee;
+$panel-background-color: $white;
$primary-color: $black;
-$border-radius: 4px;
-$border-width: 2px;
-$border-color: $black;
+$border-radius: 8px;
+$panel-radius: 12px;
+$border-width: 1px;
+$border-color-bold: rgba(0, 0, 0);
+$border-color-transparent: rgba($border-color-bold, 0.2);
$text-color: $black;