Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
PlaygroundOutputMoveButton.tsx2.56 kB
import { Button, Icon, Icons, Tooltip, TooltipArrow, TooltipTrigger, } from "@phoenix/components"; import { usePlaygroundContext } from "@phoenix/contexts/PlaygroundContext"; import { ChatMessage, generateMessageId, PlaygroundNormalizedInstance, } from "@phoenix/store"; import { convertMessageToolCallsToProvider } from "@phoenix/store/playground/playgroundStoreUtils"; import { safelyParseJSON } from "@phoenix/utils/jsonUtils"; import { PartialOutputToolCall } from "./PlaygroundToolCall"; import { getChatRole } from "./playgroundUtils"; export const PlaygroundOutputMoveButton = ({ instance, outputContent, toolCalls, cleanupOutput, }: { instance: PlaygroundNormalizedInstance; outputContent?: string | ChatMessage[]; toolCalls: PartialOutputToolCall[]; cleanupOutput: () => void; }) => { const instanceId = instance.id; const addMessage = usePlaygroundContext((state) => state.addMessage); return ( <TooltipTrigger delay={500}> <Button size="S" leadingVisual={<Icon svg={<Icons.PlusCircleOutline />} />} aria-label="Move the output message to the end of the prompt" onPress={() => { if (instance.template.__type !== "chat") { return; } const messages = Array.isArray(outputContent) ? outputContent : outputContent ? [ { id: generateMessageId(), role: getChatRole("ai"), content: outputContent, }, ] : []; if (toolCalls.length > 0) { messages.push({ id: generateMessageId(), role: getChatRole("ai"), toolCalls: convertMessageToolCallsToProvider({ provider: instance.model.provider, toolCalls: toolCalls.map((tc) => ({ ...tc, function: { ...tc.function, arguments: safelyParseJSON(tc.function.arguments)?.json ?? tc.function.arguments, }, })), }), }); } addMessage({ playgroundInstanceId: instanceId, messages, }); cleanupOutput(); }} > Prompt </Button> <Tooltip> <TooltipArrow /> Move the output message to the end of the prompt </Tooltip> </TooltipTrigger> ); };

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