Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
useDerivedPlaygroundVariables.tsx1.29 kB
import { useMemo } from "react"; import { usePlaygroundContext } from "@phoenix/contexts/PlaygroundContext"; import { denormalizePlaygroundInstance, getVariablesMapFromInstances, } from "./playgroundUtils"; /** * Get the variable values and keys from all instances in the playground * * Variables are recomputed whenever _anything_ in the playground instances change * or when the template language changes. This can be optimized in the future. */ export const useDerivedPlaygroundVariables = () => { const input = usePlaygroundContext((state) => state.input); const instances = usePlaygroundContext((state) => state.instances); const allInstanceMessages = usePlaygroundContext( (state) => state.allInstanceMessages ); const templateFormat = usePlaygroundContext((state) => state.templateFormat); const enrichedInstances = useMemo(() => { return instances.map((instance) => denormalizePlaygroundInstance(instance, allInstanceMessages) ); }, [instances, allInstanceMessages]); const { variableKeys, variablesMap } = useMemo(() => { return getVariablesMapFromInstances({ instances: enrichedInstances, templateFormat, input, }); }, [input, enrichedInstances, templateFormat]); return { variableKeys, variablesMap }; };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Arize-ai/phoenix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server