Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
Adds chips for demo to clarify
elijahbenizzydf26de1db403
diff --git a/burr/tracking/server/backend.py b/burr/tracking/server/backend.pyindex 50030c81..52236022 100644--- a/burr/tracking/server/backend.py+++ b/burr/tracking/server/backend.py@@ -57,6 +57,15 @@ class BackendBase(abc.ABC):pass+def get_uri(project_id: str) -> str:+ project_id_map = {+ "demo:counter": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/counter",+ "demo:chatbot": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/gpt",+ "demo:conversational-rag": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/conversational-rag",+ }+ return project_id_map.get(project_id, "")++class LocalBackend(BackendBase):"""Quick implementation of a local backend for testing purposes. This is not a production backend."""@@ -77,7 +86,7 @@ class LocalBackend(BackendBase):schema.Project(name=entry,id=entry,- uri=full_path, # TODO -- figure out what+ uri=get_uri(entry),last_written=await aiofilesos.path.getmtime(full_path),created=await aiofilesos.path.getctime(full_path),num_apps=len(await aiofilesos.listdir(full_path)),diff --git a/telemetry/ui/src/components/common/chip.tsx b/telemetry/ui/src/components/common/chip.tsxindex e9672562..117b1b9b 100644--- a/telemetry/ui/src/components/common/chip.tsx+++ b/telemetry/ui/src/components/common/chip.tsx@@ -6,7 +6,9 @@ const chipColorMap = {input: 'bg-yellow-500',success: 'bg-green-500',failure: 'bg-dwred',- running: 'bg-dwlightblue'+ running: 'bg-dwlightblue',+ demo: 'bg-yellow-400',+ test: 'bg-gray-800'};export type ChipType = keyof typeof chipColorMap;@@ -23,7 +25,8 @@ export const Chip = (props: { label: string; chipType: ChipType; className?: strclassName={`relative grid select-none items-center whitespace-nowrap rounded-lgp-1 px-3 font-sans text-xs font-semibold text-white ${bgColor} ${props.className ? props.className : ''- }`}>+ }`}+ ><span className="">{props.label}</span></div>);diff --git a/telemetry/ui/src/components/routes/AppList.tsx b/telemetry/ui/src/components/routes/AppList.tsxindex fd6e020d..da9eca95 100644--- a/telemetry/ui/src/components/routes/AppList.tsx+++ b/telemetry/ui/src/components/routes/AppList.tsx@@ -59,7 +59,11 @@ export const AppListTable = (props: { apps: ApplicationSummary[]; projectId: str</TableHead><TableBody>{appsToDisplay.map((app) => (- <TableRow key={app.app_id}>+ <TableRow+ key={props.projectId}+ className="hover:bg-gray-50 cursor-pointer"+ href={`/project/${props.projectId}/${app.app_id}`}+ ><TableCell className="font-semibold text-gray-700">{app.app_id}</TableCell><TableCell><DateTimeDisplay date={app.first_written} mode="long" />diff --git a/telemetry/ui/src/components/routes/ProjectList.tsx b/telemetry/ui/src/components/routes/ProjectList.tsxindex e0583336..aa7d4fa9 100644--- a/telemetry/ui/src/components/routes/ProjectList.tsx+++ b/telemetry/ui/src/components/routes/ProjectList.tsx@@ -4,6 +4,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '.import { Loading } from '../common/loading';import { DateDisplay } from '../common/dates';import { Button } from '../common/button';+import { Chip } from '../common/chip';/*** Table of a project list. Uses the tailwind catalyst component.@@ -21,31 +22,60 @@ export const ProjectListTable = (props: { projects: Project[] }) => {<TableHeader>Name</TableHeader><TableHeader>Created</TableHeader><TableHeader>Last Run</TableHeader>+ <TableHeader>Link</TableHeader><TableHeader>App Runs</TableHeader><TableHeader></TableHeader></TableRow></TableHead><TableBody>- {projectsSorted.map((project) => (- <TableRow key={project.id}>- <TableCell className="font-semibold text-gray-700">{project.name}</TableCell>- <TableCell>- <DateDisplay date={project.created} />- </TableCell>- <TableCell>- <DateDisplay date={project.last_written} />- </TableCell>- <TableCell>{project.num_apps}</TableCell>- {/* <TableCell>- <code className="text-gray-600">{project.uri}</code>- </TableCell> */}- <TableCell>- <Button color="white" href={`/project/${project.id}`}>- App Runs- </Button>- </TableCell>- </TableRow>- ))}+ {projectsSorted.map((project) => {+ let projectName = project.name;+ const chipType = projectName.startsWith('demo:')+ ? 'demo'+ : projectName.startsWith('test:')+ ? 'test'+ : undefined;+ if (chipType) {+ projectName = projectName.slice(5);+ }++ return (+ <TableRow+ key={project.id}+ className="hover:bg-gray-50 cursor-pointer"+ href={`/project/${project.id}`}+ >+ <TableCell className="font-semibold text-gray-700">+ <div className="flex flex-row gap-1">+ {chipType !== undefined && <Chip label={chipType} chipType={chipType}></Chip>}+ {projectName}+ </div>+ </TableCell>+ <TableCell>+ <DateDisplay date={project.created} />+ </TableCell>+ <TableCell>+ <DateDisplay date={project.last_written} />+ </TableCell>+ <TableCell>+ <a+ href={project.uri}+ className="text-dwlightblue hover:underline"+ target="_blank"+ rel="noreferrer"+ >+ {project.uri.replace('https://github.com/DAGWorks-Inc/burr/tree/main/', '')}+ </a>+ </TableCell>+ <TableCell>{project.num_apps}</TableCell>+ <TableCell>+ <Button color="white" href={`/project/${project.id}`}>+ App Runs+ </Button>+ </TableCell>+ </TableRow>+ );+ })}</TableBody></Table>);