Skip to main content
Glama
Arize-ai

@arizeai/phoenix-mcp

Official
by Arize-ai
bind_evaluator_example.ts1.14 kB
/* eslint-disable no-console */ import { bindEvaluator, createHallucinationEvaluator } from "../src"; import { openai } from "@ai-sdk/openai"; const model = openai("gpt-4o-mini"); type ExampleType = { question: string; context: string; answer: string; }; const examples: ExampleType[] = [ { question: "Is Arize Phoenix Open Source?", context: "Arize Phoenix is a platform for building and deploying AI applications. It is open source.", answer: "Arize is not open source.", }, { question: "Does Arize Phoenix cost money?", context: "Arize Phoenix is a platform for building and deploying AI applications. It is free to use.", answer: "No, Arize Phoenix is free to use.", }, ]; async function main() { const evaluator = bindEvaluator<ExampleType>( createHallucinationEvaluator({ model, }), { inputMapping: { input: "question", reference: "context", output: "answer", }, } ); for (const example of examples) { const result = await evaluator.evaluate(example); console.log(result); } } main().catch(console.error);

Latest Blog Posts

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