From 2b313a0a6f9ff200b12c8998e1b3bfb3b922e56f Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Wed, 31 Jul 2024 18:14:51 -0600 Subject: [PATCH] chore: add filled icons for spans (#4095) --- app/src/components/trace/SpanKindIcon.tsx | 286 +++++++++++++++++++++- 1 file changed, 275 insertions(+), 11 deletions(-) diff --git a/app/src/components/trace/SpanKindIcon.tsx b/app/src/components/trace/SpanKindIcon.tsx index 43fd1a6691..5b7ecf1df5 100644 --- a/app/src/components/trace/SpanKindIcon.tsx +++ b/app/src/components/trace/SpanKindIcon.tsx @@ -34,6 +34,38 @@ const ToolSVG = () => ( ); +const ToolFilledSVG = () => ( + + + + + + + +); + const LLMSVG = () => ( ( ); +const LLMFilledSVG = () => ( + + + + +); + const AgentSVG = () => ( ( ); +const AgentFilledSVG = () => ( + + + + + +); + const EmbeddingSVG = () => ( ( ); +const EmbeddingFilledSVG = () => ( + + + + +); + const RetrieverSVG = () => ( ( ); +const RetrieverFilledSVG = () => ( + + + + + + + +); + const RerankerSVG = () => ( ( ); +const RerankerFilledSVG = () => ( + + + + + +); + const ChainSVG = () => ( ( ); +const ChainFilledSVG = () => ( + + + + +); + const UnknownSVG = () => ( ( ); +const UnknownFilledSVG = () => ( + + + +); + const EvaluatorSVG = () => ( ( ); +const EvaluatorFilledSVG = () => ( + + + + + +); + const GuardrailSVG = () => ( ( ); -export function SpanKindIcon({ spanKind }: { spanKind: string }) { - let icon = ; +const GuardrailFilledSVG = () => ( + + + + +); + +export function SpanKindIcon({ + spanKind, + variant = "fill", +}: { + spanKind: string; + variant?: "fill" | "outline"; +}) { + const isFilled = variant === "fill"; + let icon = isFilled ? : ; let color = "--ac-global-color-grey-900"; switch (spanKind) { case "llm": color = "--ac-global-color-orange-1000"; - icon = ; + icon = isFilled ? : ; break; case "chain": color = "--ac-global-color-blue-1000"; - icon = ; + icon = isFilled ? : ; break; case "retriever": color = "--ac-global-color-seafoam-1000"; - icon = ; + icon = isFilled ? : ; break; case "embedding": color = "--ac-global-color-indigo-1000"; - icon = ; + icon = isFilled ? : ; break; case "agent": color = "--ac-global-text-color-900"; - icon = ; + icon = isFilled ? : ; break; case "tool": color = "--ac-global-color-yellow-1200"; - icon = ; + icon = isFilled ? : ; break; case "reranker": color = "--ac-global-color-celery-1000"; - icon = ; + icon = isFilled ? : ; break; case "evaluator": color = "--ac-global-color-indigo-1000"; - icon = ; + icon = isFilled ? : ; break; case "guardrail": color = "--ac-global-color-fuchsia-1200"; - icon = ; + icon = isFilled ? : ; break; }