Use the phoenix client to capture end-user feedback
This assumes annotations as of arize-phoenix>=9.0.0.
When building LLM applications, it is important to collect feedback to understand how your app is performing in production. Phoenix lets you attach feedback to spans and traces in the form of annotations.Annotations come from a few different sources:
Human Annotators
End users of your application
LLMs-as-Judges
Basic code checks
You can use the Phoenix SDK and API to attach feedback to a span.Phoenix expects feedback to be in the form of an annotation. Annotations consist of these fields:
{ "span_id": "67f6740bbe1ddc3f", // the id of the span to annotate "name": "correctness", // the name of your annotation "annotator_kind": "HUMAN", // HUMAN, LLM, CODE, DECISION, or AGENT "result": { "label": "correct", // A human-readable category for the feedback "score": 0.85, // a numeric score, can be 0 or 1, or a range like 0 to 100 "explanation": "The response answered the question I asked" }, "metadata": { "model": "gpt-4", "threshold_ms": 500, "confidence": "high" }, "identifier": "user-123" // optional, identifies the annotation and enables upserts}
Note that you can provide a label, score, or explanation. With Phoenix an annotation has a name (like correctness), is associated with an annotator (LLM, HUMAN, CODE, DECISION, or AGENT), and can be attached to the spans you have logged to Phoenix. DECISION marks annotations produced by a decision model. AGENT marks annotations produced by an AI agent.
Phoenix allows you to log multiple annotations of the same name to the same span. For example, a single span could have 5 different “correctness” annotations. This can be useful when collecting end user feedback.Note: The API will overwrite span annotations of the same name, unless they have different “identifier” values.If you want to track multiple annotations of the same name on the same span, make sure to include different “identifier” values on each.
Send Annotations to Phoenix
Once you construct the annotation, you can send this to Phoenix via its REST API. You can POST an annotation from your application to /v1/span_annotations like so:
These examples use the REST API (/v1/span_annotations), where span_id is an OpenTelemetry hex ID (for example, "67f6740bbe1ddc3f").If you use the GraphQLcreateSpanAnnotations mutation directly, pass the span’s GraphQL id (Global ID), not the OpenTelemetry hex span_id.
If you’re self-hosting Phoenix, be sure to change the endpoint in the code below to <your phoenix endpoint>/v1/span_annotations?sync=false
Python
TypeScript
curl
Retrieve the current span_idIf you’d like to collect feedback on currently instrumented code, you can get the current span using the opentelemetry SDK.
from opentelemetry.trace import format_span_id, get_current_spanspan = get_current_span()span_id = format_span_id(span.get_span_context().span_id)
You can use the span_id to send an annotation associated with that span.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Phoenix","colors":{"primary":"#00769E","light":"#39C7FF","dark":"#009DD2"},"logo":{"light":"https://mintcdn.com/arizeai-433a7140/fitXeWll7ezQrIcg/docs/logo/light.png?fit=max\u0026auto=format\u0026n=fitXeWll7ezQrIcg\u0026q=85\u0026s=78e92baf10dd9eced114496ccb88dbf1","dark":"https://mintcdn.com/arizeai-433a7140/fitXeWll7ezQrIcg/docs/logo/dark.png?fit=max\u0026auto=format\u0026n=fitXeWll7ezQrIcg\u0026q=85\u0026s=ef36a0515f1c575affb91f81496ce2f3"},"favicon":"https://mintcdn.com/arizeai-433a7140/fitXeWll7ezQrIcg/docs/favicon.png?fit=max\u0026auto=format\u0026n=fitXeWll7ezQrIcg\u0026q=85\u0026s=7c6d0d7347821750d998c57c334ca376","background":{"color":{"light":"#FFFFFF","dark":"#08090A"}},"navbar":{"links":[]},"footer":{"socials":{"slack":"https://join.slack.com/t/arize-ai/shared_invite/zt-3r07iavnk-ammtATWSlF0pSrd1DsMW7g","x":"https://x.com/ArizePhoenix","bluesky":"https://bsky.app/profile/arize-phoenix.bsky.social","linkedin":"https://www.linkedin.com/showcase/113218220","github":"https://github.com/Arize-ai/phoenix"},"links":[{"items":[{"label":"Blog","href":"https://arize.com/blog?cat=phoenix"}]},{"items":[{"label":"English","href":"/docs/phoenix"},{"label":"日本語 (Japanese)","href":"/docs/phoenix/documentation/jp"},{"label":"中文 (Chinese)","href":"/docs/phoenix/documentation/zh"}]}]},"seo":{"metatags":{"canonical":"https://arize.com"},"indexing":"all"},"fonts":{"heading":{"family":"Geist","weight":600},"body":{"family":"Geist"}},"styling":{"codeblocks":{"theme":{"light":"github-light-default","dark":"github-dark-default"}},"latex":true},"integrations":{"gtm":{"tagId":"GTM-W96XM35"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity"],"display":"header"},"interaction":{"drilldown":false},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"arizeai-433a7140","hasAudioNarration":false,"actualSubdomain":"arizeai-433a7140","customDomains":[],"gitSource":{"type":"github","owner":"arize-ai","repo":"phoenix","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af5156ced91c03d4f140665","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Integrations","count":211},{"language":"default","tag":"Documentation","count":177},{"language":"default","tag":"Release Notes","count":175},{"language":"default","tag":"SDK \u0026 API Reference","count":145},{"language":"default","tag":"Rest API","count":106},{"language":"default","tag":"API Reference","count":105},{"language":"default","tag":"LLM Providers","count":71},{"language":"default","tag":"Python","count":69},{"language":"default","tag":"Tracing","count":64},{"language":"default","tag":"Evaluation","count":61}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@arize.com"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"docs/style.css","content":"@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600\u0026display=swap');html:root{--font-family-mono-custom: 'Geist Mono'}html:root{--gray-50: 247 247 248;--gray-100: 241 242 243;--gray-200: 228 229 232;--gray-300: 201 203 208;--gray-400: 161 164 171;--gray-500: 124 128 136;--gray-600: 86 90 98;--gray-700: 61 64 70;--gray-800: 43 45 49;--gray-900: 21 22 22;--gray-950: 8 9 10}html:root{--px-radius-sm: 2px;--px-radius-md: 6px;--px-radius-lg: 8px;--px-accent-bg: #009DD2}html:not(.dark){--px-bg: #FFFFFF;--px-surface: #F7F7F8;--px-code-bg: #F1F2F3;--px-chip: #E9EAEC;--px-line: rgba(8, 9, 10, 0.18);--px-t1: #08090A;--px-t2: #2B2D31;--px-t3: #3D4046;--px-accent: #00769E;--px-accent-line: rgba(0, 157, 210, 0.55);--px-accent-soft: #E7F3FD;--px-on-accent: #08090A;--px-note: #E8F3EC;--px-note-line: rgba(30, 70, 50, 0.24);--px-note-t: #1B4230;--px-warn: #FBEEE0;--px-warn-line: rgba(90, 50, 0, 0.24);--px-warn-t: #54300A;--px-blue: #E7F3FD;--px-blue-line: rgba(0, 82, 125, 0.24);--px-blue-t: #00527D;--px-danger: #FFEBE9;--px-danger-line: rgba(207, 34, 46, 0.28);--px-danger-t: #A40E26}html.dark{--px-bg: #08090A;--px-surface: #151616;--px-code-bg: #050506;--px-chip: #1E2226;--px-line: rgba(194, 196, 234, 0.20);--px-t1: #FFFFFF;--px-t2: #D5D7DB;--px-t3: #A1A4AB;--px-accent: #39C7FF;--px-accent-line: rgba(57, 199, 255, 0.45);--px-accent-soft: #122F3B;--px-on-accent: #08090A;--px-note: #10241A;--px-note-line: rgba(159, 224, 188, 0.30);--px-note-t: #9FE0BC;--px-warn: #2A1B0A;--px-warn-line: rgba(255, 201, 138, 0.30);--px-warn-t: #FFC98A;--px-blue: #0A1A24;--px-blue-line: rgba(57, 195, 255, 0.30);--px-blue-t: #97D8FF;--px-danger: #2A0F12;--px-danger-line: rgba(255, 138, 148, 0.30);--px-danger-t: #FFB3B8}#content{line-height:1.75}#page-title,#content h1{font-size:clamp(2rem, 1.4rem + 2.1vw, 2.875rem);line-height:1.12;letter-spacing:-0.02em;font-weight:600}#content h2,#content h3,#content h4{letter-spacing:-0.01em;font-weight:600}#content code,#content kbd,#content samp{font-feature-settings:'tnum' 1}#content a:not(.card){color:var(--px-accent);text-decoration-thickness:1px;text-underline-offset:3px}:focus-visible{outline:2px solid var(--px-accent-line);outline-offset:2px}html.dark :focus-visible{outline-color:var(--px-accent-line)}::selection{background:var(--px-accent-soft)}#navbar{background:var(--px-bg);border-bottom:1px solid var(--px-line)}#navbar div:has(>.nav-tabs){position:relative}#navbar div:has(>.nav-tabs)::before{content:'';position:absolute;top:0;left:50%;width:100vw;margin-left:-50vw;border-top:1px solid var(--px-line);pointer-events:none}.nav-tabs-item[data-active]{box-shadow:inset 0 -2px 0 var(--px-accent)}#search-bar-entry{background:var(--px-surface);border:1px solid var(--px-line);border-radius:var(--px-radius-md)}#assistant-entry{background:var(--px-surface);border:1px solid var(--px-accent-line);border-radius:var(--px-radius-md)}#assistant-entry svg{color:var(--px-accent)}#page-context-menu{font-size:0.9375rem;align-items:stretch}.page-context-dropdown{font-size:0.9375rem;align-items:stretch}.product-selector{position:relative;display:inline-flex;align-items:stretch;flex:0 0 auto}.product-selector--desktop{margin-left:0.75rem;align-self:center}#page-context-menu-button{padding:10px 14px;border-radius:var(--px-radius-md) 0 0 var(--px-radius-md);background:var(--px-surface);border-color:var(--px-line)}.page-context-dropdown__label{display:inline-flex;align-items:center;padding:10px 14px;border:1px solid var(--px-line);border-radius:var(--px-radius-md) 0 0 var(--px-radius-md);background:var(--px-surface);border-color:var(--px-line);color:var(--px-t1);font-family:inherit;font-weight:400;text-decoration:none}#page-context-menu-button>div{font-size:0.9375rem;gap:9px}#page-context-menu>button[aria-haspopup]{height:auto;align-self:stretch;aspect-ratio:auto;padding:10px 11px;border-radius:0 var(--px-radius-md) var(--px-radius-md) 0;background:var(--px-surface);border-color:var(--px-line)}.page-context-dropdown__chevron{display:inline-flex;align-items:center;height:auto;align-self:stretch;aspect-ratio:auto;padding:10px 11px;border:1px solid var(--px-line);border-left:0;border-radius:0 var(--px-radius-md) var(--px-radius-md) 0;background:var(--px-surface);color:var(--px-t3);cursor:pointer}.page-context-dropdown__chevron svg{display:block;width:1rem;height:1rem;transition:transform 150ms ease}.page-context-dropdown__chevron[aria-expanded=\"true\"] svg{transform:rotate(180deg)}.page-context-dropdown__menu{position:absolute;z-index:60;top:calc(100% + 0.55rem);left:0;min-width:12.5rem;padding:0.4rem;background:var(--px-bg);border:1px solid var(--px-line);border-radius:var(--px-radius-md);box-shadow:0 0.75rem 1.5rem rgb(8 9 10 / 0.18)}.page-context-dropdown__menu[hidden]{display:none}.page-context-dropdown__item{display:flex;align-items:center;justify-content:space-between;min-height:2.5rem;padding:0.55rem 0.65rem;color:var(--px-t1);border-radius:var(--px-radius-sm);text-decoration:none}.page-context-dropdown__item:hover,.page-context-dropdown__item:focus-visible{color:var(--px-accent);background:var(--px-accent-soft)}.page-context-dropdown__item[data-selected=\"true\"]{color:var(--px-accent);font-weight:500}.page-context-dropdown__item[data-selected=\"true\"]::after{content:'✓';margin-left:1.5rem}@media (max-width: 767px){#navbar .product-selector--desktop{display:none}#mobile-nav-content .product-selector--mobile{margin:0.5rem 0 1rem}#mobile-nav-content .page-context-dropdown__label{flex:1 1 auto}#mobile-nav-content .page-context-dropdown__menu{position:static;margin-top:0.4rem}}#sidebar-content li[data-active]>a{background:var(--px-accent-soft);color:var(--px-accent);border-radius:var(--px-radius-md);font-weight:500}.sidebar-group-header{font-weight:600;color:var(--px-t1)}ul.sidebar-group:has(>li[id=\"/docs/phoenix/get-started\"]),ul.sidebar-group:has(>li[id=\"/docs/phoenix/integrations/developer-tools/coding-agents\"]),ul.sidebar-group:has(>li[id=\"/docs/phoenix/pxi\"]){margin-top:1px}.toc-item[data-active],.toc-item[data-active] a{color:var(--px-accent);font-weight:400}.card.card{background:var(--px-surface);border-color:var(--px-line);border-radius:var(--px-radius-lg);box-shadow:none}.frame.frame{background:var(--px-surface);border:1px solid var(--px-line);border-radius:var(--px-radius-lg)}.accordion.accordion,.accordion-group.accordion-group{border-radius:var(--px-radius-md);border-color:var(--px-line)}.accordion.accordion{background:var(--px-surface)}.code-block.code-block,.code-group.code-group{background:var(--px-code-bg);border-color:var(--px-line);border-radius:var(--px-radius-md)}.code-block-background{background:var(--px-code-bg)!important}html.dark .code-block-background{background:var(--px-code-bg)!important}#content :not(pre)>code{background:var(--px-chip);border-radius:var(--px-radius-sm)}.code-block:has([data-floating-buttons]) [data-fade-overlay]{background-image:none}[data-floating-buttons] button{background:var(--px-chip)}.callout .code-block.code-block,.callout .code-group.code-group,.callout .code-block-background,html.dark .callout .code-block-background{background:var(--px-bg)!important}.callout{border-radius:var(--px-radius-lg)}.callout[data-callout-type=\"callout\"],.callout[data-callout-type=\"info\"]{background:var(--px-surface);border-color:var(--px-line)}.callout[data-callout-type=\"callout\"] [data-component-part=\"callout-content\"],.callout[data-callout-type=\"info\"] [data-component-part=\"callout-content\"]{color:var(--px-t2)!important}.callout[data-callout-type=\"tip\"],.callout[data-callout-type=\"check\"]{background:var(--px-note);border-color:var(--px-note-line)}.callout[data-callout-type=\"tip\"] [data-component-part=\"callout-content\"],.callout[data-callout-type=\"check\"] [data-component-part=\"callout-content\"]{color:var(--px-note-t)!important}.callout[data-callout-type=\"warning\"]{background:var(--px-warn);border-color:var(--px-warn-line)}.callout[data-callout-type=\"warning\"] [data-component-part=\"callout-content\"]{color:var(--px-warn-t)!important}.callout[data-callout-type=\"note\"]{background:var(--px-blue);border-color:var(--px-blue-line)}.callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"]{color:var(--px-blue-t)!important}.callout[data-callout-type=\"danger\"]{background:var(--px-danger);border-color:var(--px-danger-line)}.callout[data-callout-type=\"danger\"] [data-component-part=\"callout-content\"]{color:var(--px-danger-t)!important}[data-component-part=\"step-number\"]>div{background:var(--px-accent-soft);border:1px solid var(--px-accent-line);color:var(--px-accent);font-weight:500}.update.update-container{flex-direction:column;gap:0.5rem;border-top:1px solid var(--px-line)}.update.update-container:first-of-type{border-top:none}.update.update-container>div:first-child{width:100%;position:static}.update.update-container>div:last-child{width:100%;max-width:none}#content th{color:var(--px-t1);font-weight:600;border-bottom:1px solid var(--px-line)}#content td{border-bottom:1px solid var(--px-line)}footer{border-top:1px solid var(--px-line)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}table{display:table!important}.step-title{font-size:1.5rem!important}.dark .invert-on-dark{filter:invert(1)}.release-update-read-more{display:inline-block;margin-top:0.75rem;font-weight:500;color:var(--primary);text-decoration:none}"}],"page":{"pagePath":"docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback","slug":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback","pageMetadata":{"title":"Annotating via the Client","description":"Use the phoenix client to capture end-user feedback","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use the phoenix client to capture end-user feedback\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Check,CodeBlock,Frame,Heading,Info,OptimizedImage,Tab,Tabs,Warning}=_components;if(!Check)_missingMdxReference(`Check`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[`This assumes annotations as of `,_jsx(_components.code,{children:`arize-phoenix>=9.0.0`}),`.`]})}),`\n`,_jsx(Frame,{caption:``,children:_jsx(OptimizedImage,{src:`https://storage.googleapis.com/arize-phoenix-assets/assets/images/phoenix-docs-images/3e4a596d-image.jpeg`,alt:`Application, backend, and Phoenix sequence for capturing feedback on a span`})}),`\n`,_jsx(_components.p,{children:`When building LLM applications, it is important to collect feedback to understand how your app is performing in production. Phoenix lets you attach feedback to spans and traces in the form of annotations.`}),`\n`,_jsx(_components.p,{children:`Annotations come from a few different sources:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Human Annotators`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`End users of your application`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`LLMs-as-Judges`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Basic code checks`}),`\n`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`You can use the Phoenix SDK and API to attach feedback to a span.`}),`\n`,_jsxs(_components.p,{children:[`Phoenix expects feedback to be in the form of an `,_jsx(_components.strong,{children:`annotation.`}),` Annotations consist of these fields:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"span_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"67f6740bbe1ddc3f\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:`// the id of the span to annotate`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"correctness\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:`// the name of your annotation`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"annotator_kind\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"HUMAN\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:`// HUMAN, LLM, CODE, DECISION, or AGENT`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"label\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"correct\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:`// A human-readable category for the feedback`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"score\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`0.85`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:`// a numeric score, can be 0 or 1, or a range like 0 to 100`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"explanation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"The response answered the question I asked\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"gpt-4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"threshold_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`500`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"confidence\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"high\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#7EE787`},children:` \"identifier\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"user-123\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:` // optional, identifies the annotation and enables upserts`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note that you can provide a `,_jsx(_components.strong,{children:`label`}),`, `,_jsx(_components.strong,{children:`score`}),`, or `,_jsx(_components.strong,{children:`explanation`}),`. With Phoenix an annotation has a name (like `,_jsx(_components.strong,{children:`correctness`}),`), is associated with an `,_jsx(_components.strong,{children:`annotator`}),` (`,_jsx(_components.strong,{children:`LLM`}),`, `,_jsx(_components.strong,{children:`HUMAN`}),`, `,_jsx(_components.strong,{children:`CODE`}),`, `,_jsx(_components.strong,{children:`DECISION`}),`, or `,_jsx(_components.strong,{children:`AGENT`}),`), and can be attached to the `,_jsx(_components.strong,{children:`spans`}),` you have logged to Phoenix. `,_jsx(_components.strong,{children:`DECISION`}),` marks annotations produced by a decision model. `,_jsx(_components.strong,{children:`AGENT`}),` marks annotations produced by an AI agent.`]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:`Phoenix allows you to log multiple annotations of the same name to the same span. For example, a single span could have 5 different “correctness” annotations. This can be useful when collecting end user feedback.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Note:`}),` The API will `,_jsx(_components.strong,{children:`overwrite`}),` span annotations of the same name, unless they have different “identifier” values.`]}),_jsx(_components.p,{children:`If you want to track multiple annotations of the same name on the same span, make sure to include different “identifier” values on each.`})]}),`\n`,_jsx(Heading,{level:`2`,id:`send-annotations-to-phoenix`,children:`Send Annotations to Phoenix`}),`\n`,_jsxs(_components.p,{children:[`Once you construct the annotation, you can send this to Phoenix via its REST API. You can POST an annotation from your application to `,_jsx(_components.code,{children:`/v1/span_annotations`}),` like so:`]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[`These examples use the `,_jsx(_components.strong,{children:`REST API`}),` (`,_jsx(_components.code,{children:`/v1/span_annotations`}),`), where `,_jsx(_components.code,{children:`span_id`}),` is an OpenTelemetry hex ID (for example, `,_jsx(_components.code,{children:`\"67f6740bbe1ddc3f\"`}),`).`]}),_jsxs(_components.p,{children:[`If you use the `,_jsx(_components.strong,{children:`GraphQL`}),` `,_jsx(_components.code,{children:`createSpanAnnotations`}),` mutation directly, pass the span’s GraphQL `,_jsx(_components.code,{children:`id`}),` (Global ID), not the OpenTelemetry hex `,_jsx(_components.code,{children:`span_id`}),`.`]})]}),`\n`,_jsx(Check,{children:_jsxs(_components.p,{children:[`If you’re self-hosting Phoenix, be sure to change the endpoint in the code below to `,_jsx(_components.code,{children:`\u003cyour phoenix endpoint>/v1/span_annotations?sync=false`})]})}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Python`,icon:`python`,id:`python`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Retrieve the current span_id`})}),_jsxs(_components.p,{children:[`If you’d like to collect feedback on currently instrumented code, you can get the current span using the `,_jsx(_components.code,{children:`opentelemetry`}),` SDK.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` opentelemetry.trace `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` format_span_id, get_current_span`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`span `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` get_current_span()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`span_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` format_span_id(span.get_span_context().span_id)`})]}),`\n`]})})}),_jsx(_components.p,{children:`You can use the span_id to send an annotation associated with that span.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` phoenix.client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` Client`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` Client()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`annotation `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` client.spans.add_span_annotation(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` annotation_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"user feedback\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` annotator_kind`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"HUMAN\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` span_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`span_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` label`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`\"thumbs-up\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` score`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`)`})}),`\n`]})})})]}),_jsxs(Tab,{title:`TypeScript`,icon:`js`,id:`typescript`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Retrieve the current spanId`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` { trace } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"@opentelemetry/api\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:` chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:` // ...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` spanId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` trace.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:`getActiveSpan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`()?.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:`spanContext`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`().spanId;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`}`})}),`\n`]})})}),_jsx(_components.p,{children:`You can use the spanId to send an annotation associated with that span.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`48`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`48`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` { createClient } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` '@arizeai/phoenix-client'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` PHOENIX_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` 'your_api_key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` px`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:` createClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`({`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` options: {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#8B949E`},children:` // change to self-hosted base url if applicable`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` baseUrl: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'http://localhost:6006'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` api_key: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`PHOENIX_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` Authorization: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:\"`Bearer ${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`PHOENIX_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:\"}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:` postFeedback`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` spanId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` label`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` score`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` explanation`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` metadata`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#FFA657`},children:` Record`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`unknown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`) {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` px.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'/v1/span_annotations'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` params: { query: { sync: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` } },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` body: {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` data: [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` span_id: spanId,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` name: name,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` annotator_kind: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'HUMAN'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` result: {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` label: label,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` score: score,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` explanation: explanation `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`||`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#79C0FF`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` metadata: metadata `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` {},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`response.data) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#D2A8FF`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'Annotation failed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` response.data.data;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`}`})}),`\n`]})})})]}),_jsx(Tab,{title:`curl`,id:`curl`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`powershell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default github-dark-default`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0d1117`,color:`#1f2328`,\"--shiki-dark\":`#e6edf3`},language:`powershell`,children:_jsxs(_components.code,{language:`powershell`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`curl `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`X `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` 'http://localhost:6006/v1/span_annotations?sync=false'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` -`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'accept: application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` -`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` -`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'api_key: \u003cyour phoenix api key>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#FF7B72`},children:` -`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#E6EDF3`},children:`d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"data\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"span_id\": \"67f6740bbe1ddc3f\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"name\": \"correctness\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"annotator_kind\": \"HUMAN\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"result\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"label\": \"correct\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"score\": 0.85,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"explanation\": \"The response answered the question I asked\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"metadata\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"model\": \"gpt-4\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"threshold_ms\": 500,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` \"confidence\": \"high\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#A5D6FF`},children:`}'`})}),`\n`]})})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light-default","dark":"github-dark-default"}},"config":{},"pageMetadata":{"title":"Annotating via the Client","description":"Use the phoenix client to capture end-user feedback","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Send Annotations to Phoenix","slug":"send-annotations-to-phoenix","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/arizeai-433a7140/ad8f81ded4a76bea/docs/analytics.js","/_mintlify/custom/arizeai-433a7140/f5010f618af65dc2/docs/product-selector.js"],"subdomain":"arizeai-433a7140","siteName":"Phoenix","title":"Annotating via the Client - Phoenix","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T22:30:23.680Z","originalFileLocation":"docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use the phoenix client to capture end-user feedback\">\u003cmeta data-mint-head name=\"application-name\" content=\"Phoenix\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Annotating via the Client - Phoenix\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use the phoenix client to capture end-user feedback\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Phoenix\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://arizeai-433a7140.mintlify.site/_mintlify/api/og/v2?division=Annotate+Traces\u0026amp;title=Annotating+via+the+Client\u0026amp;description=Use+the+phoenix+client+to+capture+end-user+feedback\u0026amp;theme=150ae3cca034578e18963c56\u0026amp;signature=b934f69f155467cf7321da2c211c52239a178aa023fa766880751d13c92e098d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Annotating via the Client - Phoenix\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use the phoenix client to capture end-user feedback\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://arizeai-433a7140.mintlify.site/_mintlify/api/og/v2?division=Annotate+Traces\u0026amp;title=Annotating+via+the+Client\u0026amp;description=Use+the+phoenix+client+to+capture+end-user+feedback\u0026amp;theme=150ae3cca034578e18963c56\u0026amp;signature=b934f69f155467cf7321da2c211c52239a178aa023fa766880751d13c92e098d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/arizeai-433a7140/QaORPmVscwA-cjPG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Phoenix\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00769E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://arize.com/#organization\",\"name\":\"Phoenix\",\"url\":\"https://arize.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/arizeai-433a7140/fitXeWll7ezQrIcg/docs/logo/light.png?fit=max\u0026auto=format\u0026n=fitXeWll7ezQrIcg\u0026q=85\u0026s=78e92baf10dd9eced114496ccb88dbf1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://arize.com#website\",\"name\":\"Phoenix\",\"url\":\"https://arize.com\",\"publisher\":{\"@id\":\"https://arize.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback#webpage\",\"url\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback\",\"name\":\"Annotating via the Client\",\"description\":\"Use the phoenix client to capture end-user feedback\",\"dateModified\":\"2026-10-30T22:30:23.680Z\",\"isPartOf\":{\"@id\":\"https://arize.com#website\"},\"breadcrumb\":{\"@id\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tracing\",\"item\":\"https://arize.com/docs/phoenix/tracing/tutorial\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How-to: Tracing\",\"item\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Annotate Traces\",\"item\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Annotating via the Client\",\"item\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback#article\",\"headline\":\"Annotating via the Client\",\"name\":\"Annotating via the Client\",\"description\":\"Use the phoenix client to capture end-user feedback\",\"url\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback\",\"mainEntityOfPage\":{\"@id\":\"https://arize.com/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback#webpage\"},\"dateModified\":\"2026-10-30T22:30:23.680Z\",\"publisher\":{\"@id\":\"https://arize.com/#organization\"},\"isPartOf\":{\"@id\":\"https://arize.com#website\"}}]}\u003c/script>","agentPointerHref":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback.md","siteName":"Phoenix","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Documentation","pages":[{"title":"What is Arize Phoenix?","sidebarTitle":"What is Phoenix?","href":"/docs/phoenix"},{"group":"Quickstart","root":{"title":"Start Phoenix","href":"/docs/phoenix/get-started"},"pages":[{"title":"Start Phoenix","href":"/docs/phoenix/get-started"},{"title":"Observe","href":"/docs/phoenix/get-started/get-started-tracing"},{"title":"Evaluate","href":"/docs/phoenix/get-started/get-started-evaluations"}]},{"group":"Coding Agents","root":{"title":"Connect Your Coding Agent","href":"/docs/phoenix/integrations/developer-tools/coding-agents"},"pages":[{"title":"Connect Your Coding Agent","href":"/docs/phoenix/integrations/developer-tools/coding-agents"},{"title":"Phoenix CLI","sidebarTitle":"CLI","href":"/docs/phoenix/integrations/developer-tools/cli"},{"title":"MCP Server","href":"/docs/phoenix/integrations/mcp"},{"title":"Skills","href":"/docs/phoenix/integrations/developer-tools/skills"}]},{"group":"PXI Agent","root":{"title":"PXI","sidebarTitle":"Get Started","href":"/docs/phoenix/pxi"},"tag":"BETA","pages":[{"title":"PXI","sidebarTitle":"Get Started","href":"/docs/phoenix/pxi"},{"title":"PXI Advanced","sidebarTitle":"Advanced","href":"/docs/phoenix/pxi-advanced"}]},{"group":"Tracing","pages":[{"group":"Tutorial","pages":[{"title":"Tracing Tutorial","href":"/docs/phoenix/tracing/tutorial"},{"title":"Your First Traces","href":"/docs/phoenix/tracing/tutorial/your-first-traces"},{"title":"Annotations and Evaluation","href":"/docs/phoenix/tracing/tutorial/annotations-and-evaluations"},{"title":"Sessions","href":"/docs/phoenix/tracing/tutorial/sessions"}]},{"group":"Overview: Tracing","pages":[{"title":"Overview: Tracing","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/llm-traces"},{"title":"Projects","href":"/docs/phoenix/tracing/llm-traces/projects"},{"title":"Sessions","href":"/docs/phoenix/tracing/llm-traces/sessions"},{"title":"Annotations","href":"/docs/phoenix/tracing/llm-traces/how-to-annotate-traces"},{"title":"Metrics Dashboard","href":"/docs/phoenix/tracing/llm-traces/metrics"}]},{"group":"How-to: Tracing","pages":[{"title":"How to: Tracing","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing"},{"group":"Setup Tracing","pages":[{"title":"Setup Tracing","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing/setup-tracing"},{"title":"Setup OTEL","href":"/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-using-phoenix-otel"},{"title":"Using Tracing Helpers","href":"/docs/phoenix/tracing/how-to-tracing/setup-tracing/instrument"},{"title":"Setup Projects","href":"/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-projects"},{"title":"Setup Sessions","href":"/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-sessions"}]},{"group":"Add Metadata","pages":[{"title":"Add metadata","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing/add-metadata"},{"title":"Add Attributes, Metadata, Users","href":"/docs/phoenix/tracing/how-to-tracing/add-metadata/customize-spans"},{"title":"Instrument Prompt Templates and Prompt Variables","href":"/docs/phoenix/tracing/how-to-tracing/add-metadata/instrumenting-prompt-templates-and-prompt-variables"}]},{"group":"Annotate Traces","pages":[{"title":"Annotate Traces","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations"},{"title":"Annotating in the UI","description":"How to annotate traces in the UI for analysis and dataset curation","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/annotating-in-the-ui"},{"title":"Annotating via the Client","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/capture-feedback"},{"title":"Annotating Auto-Instrumented Spans","description":"Use the capture_span_context context manager to annotate auto-instrumented spans","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/annotating-auto-instrumented-spans"},{"title":"Running Evals on Traces","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/evaluating-phoenix-traces"},{"title":"Log Evaluation Results","href":"/docs/phoenix/tracing/how-to-tracing/feedback-and-annotations/llm-evaluations"}]},{"group":"Importing \u0026 Exporting Traces","pages":[{"title":"Importing \u0026 exporting traces","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces"},{"title":"Import Existing Traces","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/importing-existing-traces"},{"title":"Import ATIF trajectories","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/importing-atif-trajectories"},{"title":"Export Data \u0026 Query Spans","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans"},{"title":"Exporting Annotated Spans","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/exporting-annotated-spans"},{"title":"Retrieve Traces via CLI","href":"/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/retrieve-traces-via-cli"}]},{"title":"Cost Tracking","href":"/docs/phoenix/tracing/how-to-tracing/cost-tracking"},{"title":"Filter Expressions","href":"/docs/phoenix/tracing/how-to-tracing/filter-expressions"},{"group":"Advanced","pages":[{"title":"Advanced","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/how-to-tracing/advanced"},{"title":"Mask Span Attributes","href":"/docs/phoenix/tracing/how-to-tracing/advanced/masking-span-attributes"},{"title":"Suppress Tracing","href":"/docs/phoenix/tracing/how-to-tracing/advanced/suppress-tracing"},{"title":"Filter Spans to Export","href":"/docs/phoenix/tracing/how-to-tracing/advanced/modifying-spans"},{"title":"Capture Multimodal Traces","href":"/docs/phoenix/tracing/how-to-tracing/advanced/multimodal-tracing"}]}]}]},{"group":"Evaluation","pages":[{"group":"Tutorial","pages":[{"title":"Run Evals With Built-In Eval Templates","href":"/docs/phoenix/evaluation/tutorials/run-evals-with-built-in-evals"},{"title":"Customize Your LLM Endpoint","href":"/docs/phoenix/evaluation/tutorials/customize-your-llm-endpoint"},{"title":"Customize Your Evaluation Template","href":"/docs/phoenix/evaluation/tutorials/customize-eval-template"}]},{"title":"Evaluation","sidebarTitle":"Overview","href":"/docs/phoenix/evaluation/llm-evals"},{"title":"LLM as a Judge","href":"/docs/phoenix/evaluation/concepts-evals/llm-as-a-judge"},{"title":"Decision Models as a Judge","href":"/docs/phoenix/evaluation/concepts-evals/decision-models-as-a-judge"},{"group":"Client-Side Evals (SDK)","pages":[{"title":"Client-Side Evals (SDK)","sidebarTitle":"Overview","href":"/docs/phoenix/evaluation/how-to-evals"},{"group":"LLM Evaluators","pages":[{"title":"Custom LLM Evaluators","href":"/docs/phoenix/evaluation/how-to-evals/custom-llm-evaluators"},{"title":"Configuring the LLM","sidebarTitle":"Configuring the LLM","href":"/docs/phoenix/evaluation/how-to-evals/configuring-the-llm"},{"title":"Configuring the Decision Model","sidebarTitle":"Configuring the Decision Model","href":"/docs/phoenix/evaluation/how-to-evals/configuring-the-decision-model"},{"title":"Eval Prompt Templates","sidebarTitle":"Prompt Templates","href":"/docs/phoenix/evaluation/how-to-evals/prompt-formats"}]},{"title":"Code Evaluators","href":"/docs/phoenix/evaluation/how-to-evals/code-evaluators"},{"title":"Code Evaluator Output Shapes","href":"/docs/phoenix/evaluation/how-to-evals/code-evaluator-output-shapes"},{"title":"Batch Evaluations","href":"/docs/phoenix/evaluation/how-to-evals/batch-evaluations"},{"title":"Using Evals with Phoenix","href":"/docs/phoenix/evaluation/how-to-evals/using-evals-with-phoenix"},{"group":"Pre-Built Metrics","pages":[{"title":"SDK Eval Metrics","sidebarTitle":"Overview","href":"/docs/phoenix/evaluation/pre-built-metrics"},{"title":"Faithfulness","href":"/docs/phoenix/evaluation/pre-built-metrics/faithfulness"},{"title":"Hallucination","href":"/docs/phoenix/evaluation/pre-built-metrics/hallucination"},{"title":"Completeness","href":"/docs/phoenix/evaluation/pre-built-metrics/completeness"},{"title":"Conciseness","href":"/docs/phoenix/evaluation/pre-built-metrics/conciseness"},{"title":"Correctness","href":"/docs/phoenix/evaluation/pre-built-metrics/correctness"},{"title":"Retrieval Relevance","href":"/docs/phoenix/evaluation/pre-built-metrics/retrieval-relevance"},{"title":"Tool Selection","href":"/docs/phoenix/evaluation/pre-built-metrics/tool-selection"},{"title":"Tool Invocation","href":"/docs/phoenix/evaluation/pre-built-metrics/tool-invocation"},{"title":"Tool Response Handling","href":"/docs/phoenix/evaluation/pre-built-metrics/tool-response-handling"},{"title":"Refusal","href":"/docs/phoenix/evaluation/pre-built-metrics/refusal"},{"title":"Toxicity","href":"/docs/phoenix/evaluation/pre-built-metrics/toxicity"},{"title":"User Friction","href":"/docs/phoenix/evaluation/pre-built-metrics/user-friction"},{"title":"PII Detection","href":"/docs/phoenix/evaluation/pre-built-metrics/pii-detection"},{"title":"Exact Match","href":"/docs/phoenix/evaluation/pre-built-metrics/exact-match"},{"title":"Matches Regex","href":"/docs/phoenix/evaluation/pre-built-metrics/matches-regex"},{"title":"Precision / Recall / F-Score","href":"/docs/phoenix/evaluation/pre-built-metrics/precision-recall-fscore"}]}]},{"group":"Server-Side Evals (UI)","pages":[{"title":"Server Evals","sidebarTitle":"Overview","href":"/docs/phoenix/evaluation/server-evals/overview"},{"title":"LLM Evaluators","href":"/docs/phoenix/evaluation/server-evals/llm-evaluators"},{"group":"Code Evaluators","pages":[{"title":"Code Evaluators","href":"/docs/phoenix/evaluation/server-evals/code-evaluators"},{"group":"Examples","pages":[{"title":"JSON Distance","sidebarTitle":"JSON Distance","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/json-distance"},{"title":"Regex Match","sidebarTitle":"Regex Match","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/regex-match"},{"title":"Embedding Distance","sidebarTitle":"Embedding Distance","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/embedding-distance"},{"title":"scikit-learn Text Similarity","sidebarTitle":"scikit-learn","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/scikit-learn"},{"title":"Pairwise Evaluator","sidebarTitle":"Pairwise Evaluator","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/pairwise"},{"title":"Composite Evaluator","sidebarTitle":"Composite Evaluator","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/composite"},{"title":"LLM Jury","sidebarTitle":"LLM Jury","href":"/docs/phoenix/evaluation/server-evals/code-evaluators/llm-jury"}]}]},{"title":"Input Mapping","href":"/docs/phoenix/evaluation/server-evals/input-mapping"},{"group":"Pre-Built Metrics","pages":[{"title":"Pre-Built Metrics","sidebarTitle":"Overview","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics"},{"group":"Pre-built Code Evaluators","pages":[{"title":"Contains","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/contains"},{"title":"Exact Match","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/exact-match"},{"title":"Regex Match","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/regex"},{"title":"Levenshtein Distance","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/levenshtein-distance"},{"title":"JSON Distance","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/json-distance"}]},{"group":"LLM Evaluators","pages":[{"title":"Correctness","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/correctness"},{"title":"Tool Selection","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/tool-selection"},{"title":"Tool Invocation","href":"/docs/phoenix/evaluation/server-evals/pre-built-metrics/tool-invocation"}]}]}]},{"group":"Integrations","pages":[{"title":"Harbor","href":"/docs/phoenix/integrations/evaluation-integrations/harbor"},{"title":"pytest","href":"/docs/phoenix/evaluation/integrations/pytest"},{"title":"Vitest / Jest","href":"/docs/phoenix/evaluation/integrations/vitest-jest"}]}]},{"group":"Datasets \u0026 Experiments","pages":[{"group":"Tutorial","pages":[{"title":"Defining the Dataset That Powers Your Experiments","href":"/docs/phoenix/datasets-and-experiments/tutorial/defining-the-dataset"},{"title":"Run Experiments with Code Evals","href":"/docs/phoenix/datasets-and-experiments/tutorial/run-experiments-with-code-evals"},{"title":"Run Experiments with LLM as a Judge","href":"/docs/phoenix/datasets-and-experiments/tutorial/run-experiments-with-llm-judge"},{"title":"Iterating with Experiments in Your Workflow","href":"/docs/phoenix/datasets-and-experiments/tutorial/iteration-workflow-experiments"}]},{"title":"Overview: Datasets \u0026 Experiments","href":"/docs/phoenix/datasets-and-experiments/overview-datasets"},{"group":"How-to: Datasets","pages":[{"title":"How to: Datasets","sidebarTitle":"Overview","href":"/docs/phoenix/datasets-and-experiments/how-to-datasets"},{"title":"Creating Datasets","href":"/docs/phoenix/datasets-and-experiments/how-to-datasets/creating-datasets"},{"title":"Updating Datasets","href":"/docs/phoenix/datasets-and-experiments/how-to-datasets/updating-datasets"},{"title":"Exporting Datasets","href":"/docs/phoenix/datasets-and-experiments/how-to-datasets/exporting-datasets"},{"title":"Linking Examples to Their Source Span (REST)","href":"/docs/phoenix/datasets-and-experiments/how-to-datasets/linking-examples-to-spans"}]},{"group":"How-to: Experiments","pages":[{"title":"How to: Experiments","sidebarTitle":"Overview","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments"},{"title":"Run Experiments","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/running-experiments"},{"title":"Evaluate a Prompt Change in Code","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/evaluate-a-prompt-change"},{"title":"Run Experiments in the Background","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/running-experiments-in-background"},{"title":"Using Evaluators","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/using-evaluators"},{"title":"Dataset Evaluators","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/how-to-dataset-evaluators"},{"title":"Repetitions","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/repetitions"},{"title":"Splits","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/splits"},{"title":"Eval CI with pytest","href":"/docs/phoenix/datasets-and-experiments/how-to-experiments/eval-ci-with-pytest"}]}]},{"group":"Prompts","pages":[{"group":"Tutorial","pages":[{"title":"Tutorial","sidebarTitle":"Overview","href":"/docs/phoenix/prompt-engineering/tutorial"},{"title":"Identify \u0026 Edit Prompts","href":"/docs/phoenix/prompt-engineering/tutorial/identify-and-edit-prompts"},{"title":"Test Prompts at Scale","href":"/docs/phoenix/prompt-engineering/tutorial/test-prompts-at-scale"},{"title":"Compare Prompt Versions","href":"/docs/phoenix/prompt-engineering/tutorial/compare-prompt-versions"},{"title":"Optimize Prompts Automatically","href":"/docs/phoenix/prompt-engineering/tutorial/optimize-prompts-automatically"}]},{"group":"Overview: Prompts","pages":[{"title":"Overview: Prompts","sidebarTitle":"Overview","href":"/docs/phoenix/prompt-engineering/overview-prompts"},{"title":"Prompt Management","href":"/docs/phoenix/prompt-engineering/overview-prompts/prompt-management"},{"title":"Prompt Playground","href":"/docs/phoenix/prompt-engineering/overview-prompts/prompt-playground"},{"title":"Span Replay","href":"/docs/phoenix/prompt-engineering/overview-prompts/span-replay"},{"title":"Prompts in Code","href":"/docs/phoenix/prompt-engineering/overview-prompts/prompts-in-code"}]},{"group":"How to: Prompts","pages":[{"title":"How to: Prompts","sidebarTitle":"Overview","href":"/docs/phoenix/prompt-engineering/how-to-prompts"},{"title":"Configure AI Providers","href":"/docs/phoenix/prompt-engineering/how-to-prompts/configure-ai-providers"},{"title":"Using the Playground","href":"/docs/phoenix/prompt-engineering/how-to-prompts/using-the-playground"},{"title":"Create a prompt","href":"/docs/phoenix/prompt-engineering/how-to-prompts/create-a-prompt"},{"title":"Test a prompt","href":"/docs/phoenix/prompt-engineering/how-to-prompts/test-a-prompt"},{"title":"Tag a prompt","href":"/docs/phoenix/prompt-engineering/how-to-prompts/tag-a-prompt"},{"title":"Using a prompt","href":"/docs/phoenix/prompt-engineering/how-to-prompts/using-a-prompt"},{"title":"Use provider tools","href":"/docs/phoenix/prompt-engineering/how-to-prompts/use-provider-tools"}]}]},{"group":"Settings","pages":[{"title":"Access Control (RBAC)","href":"/docs/phoenix/settings/access-control-rbac"},{"title":"API Keys","href":"/docs/phoenix/settings/api-keys"},{"title":"Secrets","href":"/docs/phoenix/settings/secrets"},{"title":"Data Retention","href":"/docs/phoenix/settings/data-retention"},{"title":"Custom AI Providers","href":"/docs/phoenix/settings/custom-ai-providers"},{"group":"Sandboxes","pages":[{"title":"Sandboxes","href":"/docs/phoenix/settings/sandboxes"},{"title":"WebAssembly","href":"/docs/phoenix/settings/sandboxes/wasm"},{"title":"Deno","href":"/docs/phoenix/settings/sandboxes/deno"},{"title":"E2B","href":"/docs/phoenix/settings/sandboxes/e2b"},{"title":"Daytona","href":"/docs/phoenix/settings/sandboxes/daytona"},{"title":"Vercel Sandbox","href":"/docs/phoenix/settings/sandboxes/vercel"},{"title":"Modal","href":"/docs/phoenix/settings/sandboxes/modal"}]}]},{"group":"Concepts","pages":[{"title":"Production Guide","href":"/docs/phoenix/production-guide"},{"group":"Tracing","pages":[{"title":"What are Traces","href":"/docs/phoenix/tracing/concepts-tracing/what-are-traces"},{"title":"How Tracing Works","href":"/docs/phoenix/tracing/concepts-tracing/how-tracing-works"},{"title":"Annotations Concepts","href":"/docs/phoenix/tracing/concepts-tracing/annotations-concepts"},{"title":"Translating Semantic Conventions","href":"/docs/phoenix/tracing/concepts-tracing/translating-conventions"},{"group":"OpenTelemetry and OpenInference","pages":[{"title":"OpenTelemetry and OpenInference","sidebarTitle":"Overview","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/overview"},{"title":"Signals, Spans, Traces, and Sessions","sidebarTitle":"Signals, spans, traces, and sessions","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/signals"},{"title":"Resource","sidebarTitle":"Resource","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/resource"},{"title":"Exporter and OTLP","sidebarTitle":"Exporter and OTLP","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/exporter"},{"title":"Span Processor","sidebarTitle":"Span processor","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/span-processor"},{"title":"Tracer Provider and Tracer","sidebarTitle":"Tracer provider and tracer","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/tracer-provider"},{"title":"The phoenix.otel Helpers","sidebarTitle":"phoenix.otel helpers","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/phoenix-otel-helpers"},{"title":"OpenInference Semantic Conventions","sidebarTitle":"Semantic conventions","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/semantic-conventions"},{"title":"OpenInference Span Kinds","sidebarTitle":"Span kinds","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/span-kinds"},{"title":"Instrumentation Approaches","sidebarTitle":"Instrumentation approaches","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/instrumentation-approaches"},{"title":"OpenInference Context Managers","sidebarTitle":"Context managers","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/context-managers"},{"title":"Context Propagation","sidebarTitle":"Context propagation","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/context-propagation"},{"title":"Sampling","sidebarTitle":"Sampling","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/sampling"},{"title":"OpenTelemetry Collector","sidebarTitle":"OpenTelemetry Collector","href":"/docs/phoenix/tracing/concepts-tracing/otel-openinference/otel-collector"}]},{"title":"FAQs: Tracing","href":"/docs/phoenix/tracing/concepts-tracing/faqs-tracing"}]},{"group":"Prompts","pages":[{"title":"Prompts Concepts","href":"/docs/phoenix/prompt-engineering/concepts-prompts/prompts-concepts"},{"title":"Context Engineering Basics","href":"/docs/phoenix/prompt-engineering/concepts-prompts/context-engineering-basics"}]},{"group":"Datasets \u0026 Experiments","pages":[{"title":"Concepts: Datasets","href":"/docs/phoenix/datasets-and-experiments/concepts-datasets"}]}]},{"group":"Resources","pages":[{"group":"Frequently Asked Questions","pages":[{"title":"Frequently Asked Questions","sidebarTitle":"Overview","href":"/docs/phoenix/resources/frequently-asked-questions"},{"title":"Braintrust Open Source Alternative? LLM Evaluation Platform Comparison","href":"/docs/phoenix/resources/frequently-asked-questions/braintrust-open-source-alternative-llm-evaluation-platform-comparison"},{"title":"Langfuse alternative? Arize Phoenix vs Langfuse: Key differences","href":"/docs/phoenix/resources/frequently-asked-questions/langfuse-alternative-arize-phoenix-vs-langfuse-key-differences"},{"title":"Open Source LangSmith Alternative: Arize Phoenix vs. LangSmith","href":"/docs/phoenix/resources/frequently-asked-questions/open-source-langsmith-alternative-arize-phoenix-vs.-langsmith"}]},{"group":"Arize AX","root":{"title":"Arize Phoenix or Arize AX","href":"/docs/phoenix/resources/frequently-asked-questions/what-is-the-difference-between-phoenix-and-arize"},"pages":[{"title":"Arize Phoenix or Arize AX","href":"/docs/phoenix/resources/frequently-asked-questions/what-is-the-difference-between-phoenix-and-arize"},{"title":"Migrating to Arize AX","href":"/docs/phoenix/resources/phoenix-to-arize-ax-migration"}]},{"title":"TypeScript SDK","url":"/docs/phoenix/sdk-api-reference/typescript/overview","href":"/docs/phoenix/resources/typescript-api"},{"title":"Python SDK","url":"/docs/phoenix/sdk-api-reference","href":"/docs/phoenix/resources/python-api"},{"title":"Github","url":"https://github.com/Arize-ai/phoenix","href":"/docs/phoenix/resources/github"},{"title":"OpenInference","url":"https://github.com/Arize-ai/openinference","href":"/docs/phoenix/resources/openinference"}]}]},{"tab":"Learn","pages":[{"title":"Learn","href":"/docs/phoenix/learn"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/docs/phoenix/integrations"}]},{"tab":"SDK \u0026 API Reference","pages":[{"title":"SDK \u0026 API Reference","href":"/docs/phoenix/sdk-api-reference"}]},{"tab":"Self-Hosting","pages":[{"title":"Self-Hosting","href":"/docs/phoenix/self-hosting"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/docs/phoenix/cookbook"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/docs/phoenix/release-notes"}]}]},"basePath":"","title":"Annotating via the Client - Phoenix","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-D2acuaLg.js","DynamicMarkdown-Co5nikxh.js","zoom-image-lightbox-BbK2OBGL.js","lightbox-handle-r17bVUz3.js"]}