Skip to content

Commit

Permalink
refactor: use new hook for reading derived playground variables into …
Browse files Browse the repository at this point in the history
…subscription
  • Loading branch information
cephalization committed Oct 17, 2024
1 parent a290965 commit cae060b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/src/pages/playground/PlaygroundOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import { useCredentialsContext } from "@phoenix/contexts/CredentialsContext";
import { usePlaygroundContext } from "@phoenix/contexts/PlaygroundContext";
import { useChatMessageStyles } from "@phoenix/hooks/useChatMessageStyles";
import type { ToolCall } from "@phoenix/store";
import {
ChatMessage,
generateMessageId,
selectDerivedInputVariables,
} from "@phoenix/store";
import { ChatMessage, generateMessageId } from "@phoenix/store";
import { assertUnreachable } from "@phoenix/typeUtils";

import {
Expand All @@ -26,6 +22,7 @@ import {
import { isChatMessages } from "./playgroundUtils";
import { TitleWithAlphabeticIndex } from "./TitleWithAlphabeticIndex";
import { PlaygroundInstanceProps } from "./types";
import { useDerivedPlaygroundVariables } from "./useDerivedPlaygroundVariables";

interface PlaygroundOutputProps extends PlaygroundInstanceProps {}

Expand Down Expand Up @@ -221,7 +218,7 @@ function PlaygroundOutputText(props: PlaygroundInstanceProps) {
const templateLanguage = usePlaygroundContext(
(state) => state.templateLanguage
);
const templateVariables = usePlaygroundContext(selectDerivedInputVariables);
const { variablesMap: templateVariables } = useDerivedPlaygroundVariables();
const markPlaygroundInstanceComplete = usePlaygroundContext(
(state) => state.markPlaygroundInstanceComplete
);
Expand Down

0 comments on commit cae060b

Please sign in to comment.