diff --git a/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Preview/index.tsx b/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Preview/index.tsx index 1c78f5232..0afefbcd3 100644 --- a/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Preview/index.tsx +++ b/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Preview/index.tsx @@ -59,7 +59,6 @@ export default function Preview({ ref={containerRef} className='flex flex-col gap-3 h-full overflow-y-auto' > - Preview {(conversation?.messages ?? []) .filter((message) => message.role === 'assistant') .map((message, index) => ( diff --git a/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Variables/index.tsx b/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Variables/index.tsx new file mode 100644 index 000000000..585f3b1f8 --- /dev/null +++ b/apps/web/src/app/(private)/evaluations/(evaluation)/[evaluationUuid]/editor/_components/EvaluationEditor/Editor/Playground/Variables/index.tsx @@ -0,0 +1,273 @@ +'use client' + +import { ReactNode, useEffect, useState } from 'react' + +import { Config, readMetadata } from '@latitude-data/compiler' +import { ProviderLogDto } from '@latitude-data/core/browser' +import { + formatContext, + formatConversation, +} from '@latitude-data/core/services/providerLogs/formatForEvaluation' +import { + Badge, + Button, + cn, + CodeBlock, + CollapsibleBox, + Icon, + Popover, + Text, + Tooltip, +} from '@latitude-data/web-ui' +import useDocumentLogWithMetadata from '$/stores/documentLogWithMetadata' + +const PARAMETERS = [ + 'messages', + 'context', + 'response', + 'prompt', + 'parameters', + 'config', + 'duration', + 'cost', +] + +const VariableSection = ({ + title, + content, + tooltip, + height = '36', + popoverContent, +}: { + title: string + content: string + tooltip?: string + height?: string + popoverContent?: ReactNode +}) => ( +
+
+
+ {title} + {tooltip && ( + + +
+ } + > + {tooltip} + + )} +
+ {popoverContent && ( + + + + + + {popoverContent} + + + )} +
+