Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(playground): jump to playground for clickhouse reads (#4222)

Hassieb Pakzad26c02ad49c85
diff --git a/web/src/ee/features/playground/page/components/JumpToPlaygroundButton.tsx b/web/src/ee/features/playground/page/components/JumpToPlaygroundButton.tsx
index 5753ae77bd..29626bb81f 100644
--- a/web/src/ee/features/playground/page/components/JumpToPlaygroundButton.tsx
+++ b/web/src/ee/features/playground/page/components/JumpToPlaygroundButton.tsx
@@ -120,13 +120,26 @@ const parseGeneration = (generation: Observation): PlaygroundCache => {
if (generation.type !== "GENERATION") return null;
const modelParams = parseModelParams(generation);
- const input = generation.input?.valueOf();
+ let input = generation.input?.valueOf();
if (typeof input === "string") {
- return {
- messages: [createEmptyMessage(ChatMessageRole.System, input)],
- modelParams,
- };
+ try {
+ input = JSON.parse(input);
+
+ if (typeof input === "string") {
+ return {
+ messages: [createEmptyMessage(ChatMessageRole.System, input)],
+ modelParams,
+ };
+ }
+ } catch (err) {
+ return {
+ messages: [
+ createEmptyMessage(ChatMessageRole.System, input?.toString()),
+ ],
+ modelParams,
+ };
+ }
}
if (typeof input === "object") {