Skip to content

Commit

Permalink
Merge pull request #2237 from Agenta-AI/AGE-1270/-raw-data-missing-da…
Browse files Browse the repository at this point in the history
…ta-in-overview

(frontend)[Age 1270]: Raw data missing data in overview
  • Loading branch information
mmabrouk authored Nov 10, 2024
2 parents ec6213d + 1fb5d39 commit 4ba6ae7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const useStyles = createUseStyles((theme: JSSTheme) => ({
}))

const TraceContent = ({activeTrace}: TraceContentProps) => {
const {data, key, children, ...filteredTrace} = activeTrace
const {key, children, ...filteredTrace} = activeTrace
const classes = useStyles()
const [tab, setTab] = useState("overview")
const {icon, bgColor, color} = statusMapper(activeTrace.node.type)
Expand Down Expand Up @@ -137,16 +137,16 @@ const TraceContent = ({activeTrace}: TraceContentProps) => {
</Space>
)}

{data && data?.inputs ? (
{activeTrace.data && activeTrace.data?.inputs ? (
<Space direction="vertical" className="w-full" size={24}>
{activeTrace.node.type !== "chat" ? (
<AccordionTreePanel
label={"inputs"}
value={data.inputs}
value={activeTrace.data.inputs}
enableFormatSwitcher
/>
) : (
Object.entries(transformDataInputs(data.inputs)).map(
Object.entries(transformDataInputs(activeTrace.data?.inputs)).map(
([key, values]) => {
if (key === "prompt") {
return Array.isArray(values)
Expand Down Expand Up @@ -177,16 +177,16 @@ const TraceContent = ({activeTrace}: TraceContentProps) => {
</Space>
) : null}

{data && data?.outputs ? (
{activeTrace.data && activeTrace.data?.outputs ? (
<Space direction="vertical" className="w-full" size={24}>
{activeTrace.node.type !== "chat" ? (
<AccordionTreePanel
label={"outputs"}
value={data.outputs}
value={activeTrace.data.outputs}
enableFormatSwitcher
/>
) : (
Object.values(data.outputs).map((item) =>
Object.values(activeTrace.data.outputs).map((item) =>
Array.isArray(item)
? item.map((param, index) =>
!!param.content &&
Expand All @@ -212,12 +212,12 @@ const TraceContent = ({activeTrace}: TraceContentProps) => {
</Space>
) : null}

{data && data?.internals && (
{activeTrace.data && activeTrace.data?.internals && (
<Space direction="vertical" className="w-full" size={24}>
{activeTrace.node.type !== "chat" && (
<AccordionTreePanel
label={"internals"}
value={data.internals}
value={activeTrace.data.internals}
enableFormatSwitcher
/>
)}
Expand Down

0 comments on commit 4ba6ae7

Please sign in to comment.