Skip to content

Commit

Permalink
update prop type to be InitialPlaygroundState
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Oct 8, 2024
1 parent 95fc185 commit 80e35d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/pages/playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
PlaygroundProvider,
usePlaygroundContext,
} from "@phoenix/contexts/PlaygroundContext";
import { PlaygroundProps } from "@phoenix/store";
import { InitialPlaygroundState } from "@phoenix/store";

import { PlaygroundInstance } from "./PlaygroundInstance";
import { PlaygroundOperationTypeRadioGroup } from "./PlaygroundOperationTypeRadioGroup";

export function Playground(props: Partial<PlaygroundProps>) {
export function Playground(props: InitialPlaygroundState) {
return (
<PlaygroundProvider {...props}>
<View
Expand Down
4 changes: 3 additions & 1 deletion app/src/store/playgroundStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export interface PlaygroundProps {
instances: Array<PlaygroundInstance>;
}

export type InitialPlaygroundState = Partial<PlaygroundProps>;

type DatasetInput = {
datasetId: string;
};
Expand Down Expand Up @@ -192,7 +194,7 @@ const DEFAULT_TEXT_COMPLETION_TEMPLATE: PlaygroundTextCompletionTemplate = {
};

export const createPlaygroundStore = (
initialProps?: Partial<PlaygroundProps>
initialProps?: InitialPlaygroundState
) => {
const playgroundStore: StateCreator<PlaygroundState> = (set, get) => ({
operationType: "chat",
Expand Down

0 comments on commit 80e35d7

Please sign in to comment.