Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
05.14.2025-experiments-in-the-js-client.md1.98 kB
# 05.14.2025: Experiments in the JS Client {% embed url="https://storage.googleapis.com/arize-phoenix-assets/assets/images/ts-experiments-results.png" %} Experiments CLI output {% endembed %} You can now run Experiments using the Phoenix JS client! Use Experiments to test different iterations of your applications over a set of test cases, then evaluate the results. This release includes: * Native tracing of tasks and evaluators * Async concurrency queues * Support for any evaluator (including bring your own evals) ### Code Implementation ```javascript import { createClient } from "@arizeai/phoenix-client"; import { asEvaluator, runExperiment, } from "@arizeai/phoenix-client/experiments"; import type { Example } from "@arizeai/phoenix-client/types/datasets"; import { Factuality } from "autoevals"; import OpenAI from "openai"; const phoenix = createClient(); const openai = new OpenAI(); /** Your AI Task */ const task = async (example: Example) => { const response = await openai.chat.completions.create({ model: "gpt-4o", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: JSON.stringify(example.input, null, 2) }, ], }); return response.choices[0]?.message?.content ?? "No response"; }; await runExperiment({ dataset: "dataset_id", experimentName: "experiment_name", client: phoenix, task, evaluators: [ asEvaluator({ name: "Factuality", kind: "LLM", evaluate: async (params) => { const result = await Factuality({ output: JSON.stringify(params.output, null, 2), input: JSON.stringify(params.input, null, 2), expected: JSON.stringify(params.expected, null, 2), }); return { score: result.score, label: result.name, explanation: (result.metadata?.rationale as string) ?? "", metadata: result.metadata ?? {}, }; }, }), ], }); ```

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