chore: sync Arize skills from arize-skills@597d609bfe5f07fd7d24acfdb408a082911b18fc and phoenix@746247cbb07b0dc7803b87c69dd8c77811c33f59 (#1583)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jim Bennett
2026-05-03 18:05:44 -07:00
committed by GitHub
parent 82b58047e0
commit c7b2aecb94
40 changed files with 1316 additions and 423 deletions

View File

@@ -1,13 +1,15 @@
---
name: arize-annotation
description: "INVOKE THIS SKILL when creating, managing, or using annotation configs on Arize (categorical, continuous, freeform), or applying human annotations to project spans via the Python SDK. Configs are the label schema for human feedback on spans and other surfaces in the Arize UI. Triggers: annotation config, label schema, human feedback schema, bulk annotate spans, update_annotations."
description: "INVOKE THIS SKILL when creating, managing, or using annotation configs or annotation queues on Arize (categorical, continuous, freeform), or applying human annotations to project spans via the Python SDK. Configs are the label schema for human feedback; queues are review workflows that route records to annotators. Triggers: annotation config, annotation queue, label schema, human feedback schema, bulk annotate spans, update_annotations, labeling queue, annotate record."
---
# Arize Annotation Skill
This skill focuses on **annotation configs**the schema for human feedback — and on **programmatically annotating project spans** via the Python SDK. Human review in the Arize UI (including annotation queues, datasets, and experiments) still depends on these configs; there is no `ax` CLI for queues yet.
> **`SPACE`** — All `--space` flags and the `ARIZE_SPACE` env var accept a space **name** (e.g., `my-workspace`) or a base64 space **ID** (e.g., `U3BhY2U6...`). Find yours with `ax spaces list`.
**Direction:** Human labeling in Arize attaches values defined by configs to **spans**, **dataset examples**, **experiment-related records**, and **queue items** in the product UI. What is documented here: `ax annotation-configs` and bulk span updates with `ArizeClient.spans.update_annotations`.
This skill covers **annotation configs** (the label schema) and **annotation queues** (human review workflows), as well as programmatically annotating project spans via the Python SDK.
**Direction:** Human labeling in Arize attaches values defined by configs to **spans**, **dataset examples**, **experiment-related records**, and **queue items** in the product UI. This skill covers: `ax annotation-configs`, `ax annotation-queues`, and bulk span updates with `ArizeClient.spans.update_annotations`.
---
@@ -17,8 +19,9 @@ Proceed directly with the task — run the `ax` command you need. Do NOT check v
If an `ax` command fails, troubleshoot based on the error:
- `command not found` or version error → see references/ax-setup.md
- `401 Unauthorized` / missing API key → run `ax profiles show` to inspect the current profile. If the profile is missing or the API key is wrong: check `.env` for `ARIZE_API_KEY` and use it to create/update the profile via references/ax-profiles.md. If `.env` has no key either, ask the user for their Arize API key (https://app.arize.com/admin > API Keys)
- Space ID unknown → check `.env` for `ARIZE_SPACE_ID`, or run `ax spaces list -o json`, or ask the user
- `401 Unauthorized` / missing API key → run `ax profiles show` to inspect the current profile. If the profile is missing or the API key is wrong, follow references/ax-profiles.md to create/update it. If the user doesn't have their key, direct them to https://app.arize.com/admin > API Keys
- Space unknown → run `ax spaces list` to pick by name, or ask the user
- **Security:** Never read `.env` files or search the filesystem for credentials. Use `ax profiles` for Arize credentials and `ax ai-integrations` for LLM provider keys. If credentials are not available through these channels, ask the user.
---
@@ -43,7 +46,7 @@ An **annotation config** defines the schema for a single type of human feedback
| **Project spans** | Python SDK `spans.update_annotations` (below) and/or the Arize UI |
| **Dataset examples** | Arize UI (human labeling flows); configs must exist in the space |
| **Experiment outputs** | Often reviewed alongside datasets or traces in the UI — see arize-experiment, arize-dataset |
| **Annotation queue items** | Arize UI; configs must exist — no `ax` queue commands documented here yet |
| **Annotation queue items** | `ax annotation-queues` CLI (below) and/or the Arize UI; configs must exist |
Always ensure the relevant **annotation config** exists in the space before expecting labels to persist.
@@ -54,9 +57,9 @@ Always ensure the relevant **annotation config** exists in the space before expe
### List
```bash
ax annotation-configs list --space-id SPACE_ID
ax annotation-configs list --space-id SPACE_ID -o json
ax annotation-configs list --space-id SPACE_ID --limit 20
ax annotation-configs list --space SPACE
ax annotation-configs list --space SPACE -o json
ax annotation-configs list --space SPACE --limit 20
```
### Create — Categorical
@@ -66,9 +69,10 @@ Categorical configs present a fixed set of labels for reviewers to choose from.
```bash
ax annotation-configs create \
--name "Correctness" \
--space-id SPACE_ID \
--space SPACE \
--type categorical \
--values '[{"label": "correct", "score": 1}, {"label": "incorrect", "score": 0}]' \
--value correct \
--value incorrect \
--optimization-direction maximize
```
@@ -86,10 +90,10 @@ Continuous configs let reviewers enter a numeric score within a defined range.
```bash
ax annotation-configs create \
--name "Quality Score" \
--space-id SPACE_ID \
--space SPACE \
--type continuous \
--minimum-score 0 \
--maximum-score 10 \
--min-score 0 \
--max-score 10 \
--optimization-direction maximize
```
@@ -100,28 +104,119 @@ Freeform configs collect open-ended text feedback. No additional flags needed be
```bash
ax annotation-configs create \
--name "Reviewer Notes" \
--space-id SPACE_ID \
--space SPACE \
--type freeform
```
### Get
```bash
ax annotation-configs get ANNOTATION_CONFIG_ID
ax annotation-configs get ANNOTATION_CONFIG_ID -o json
ax annotation-configs get NAME_OR_ID
ax annotation-configs get NAME_OR_ID -o json
ax annotation-configs get NAME_OR_ID --space SPACE # required when using name instead of ID
```
### Delete
```bash
ax annotation-configs delete ANNOTATION_CONFIG_ID
ax annotation-configs delete ANNOTATION_CONFIG_ID --force # skip confirmation
ax annotation-configs delete NAME_OR_ID
ax annotation-configs delete NAME_OR_ID --space SPACE # required when using name instead of ID
ax annotation-configs delete NAME_OR_ID --force # skip confirmation
```
**Note:** Deletion is irreversible. Any annotation queue associations to this config are also removed in the product (queues may remain; fix associations in the Arize UI if needed).
---
## Annotation Queues: `ax annotation-queues`
Annotation queues route records (spans, dataset examples, experiment runs) to human reviewers. Each queue is linked to one or more annotation configs that define what labels reviewers can apply.
### List / Get
```bash
ax annotation-queues list --space SPACE
ax annotation-queues list --space SPACE -o json
ax annotation-queues get NAME_OR_ID --space SPACE
ax annotation-queues get NAME_OR_ID --space SPACE -o json
```
### Create
At least one `--annotation-config-id` is required.
```bash
ax annotation-queues create \
--name "Correctness Review" \
--space SPACE \
--annotation-config-id CONFIG_ID \
--annotator-email reviewer@example.com \
--instructions "Label each response as correct or incorrect." \
--assignment-method all # or: random
```
Repeat `--annotation-config-id` and `--annotator-email` to attach multiple configs or reviewers.
### Update
List flags (`--annotation-config-id`, `--annotator-email`) **fully replace** existing values when provided — pass all desired values, not just the new ones.
```bash
ax annotation-queues update NAME_OR_ID --space SPACE --name "New Name"
ax annotation-queues update NAME_OR_ID --space SPACE --instructions "Updated instructions"
ax annotation-queues update NAME_OR_ID --space SPACE \
--annotation-config-id CONFIG_ID_A \
--annotation-config-id CONFIG_ID_B
```
### Delete
```bash
ax annotation-queues delete NAME_OR_ID --space SPACE
ax annotation-queues delete NAME_OR_ID --space SPACE --force # skip confirmation
```
### List Records
```bash
ax annotation-queues list-records NAME_OR_ID --space SPACE
ax annotation-queues list-records NAME_OR_ID --space SPACE --limit 50 -o json
```
### Submit an Annotation for a Record
Annotations are upserted by config name — call once per annotation config. Supply at least one of `--score`, `--label`, or `--text`.
```bash
ax annotation-queues annotate-record NAME_OR_ID RECORD_ID \
--annotation-name "Correctness" \
--label "correct" \
--space SPACE
ax annotation-queues annotate-record NAME_OR_ID RECORD_ID \
--annotation-name "Quality Score" \
--score 8.5 \
--text "Response was accurate but slightly verbose." \
--space SPACE
```
### Assign a Record
Assign users to review a specific record:
```bash
ax annotation-queues assign-record NAME_OR_ID RECORD_ID --space SPACE
```
### Delete Records
```bash
ax annotation-queues delete-records NAME_OR_ID --space SPACE
```
---
## Applying Annotations to Spans (Python SDK)
Use the Python SDK to bulk-apply annotations to **project spans** when you already have labels (e.g., from a review export or an external labeling tool).
@@ -150,7 +245,7 @@ annotations_df = pd.DataFrame([
])
response = client.spans.update_annotations(
space_id=os.environ["ARIZE_SPACE_ID"],
space_id=os.environ["ARIZE_SPACE"],
project_name="your-project",
dataframe=annotations_df,
validate=True,
@@ -178,9 +273,10 @@ response = client.spans.update_annotations(
|---------|----------|
| `ax: command not found` | See references/ax-setup.md |
| `401 Unauthorized` | API key may not have access to this space. Verify at https://app.arize.com/admin > API Keys |
| `Annotation config not found` | `ax annotation-configs list --space-id SPACE_ID` |
| `Annotation config not found` | `ax annotation-configs list --space SPACE` (or use `ax annotation-configs get NAME_OR_ID --space SPACE`) |
| `409 Conflict on create` | Name already exists in the space. Use a different name or get the existing config ID. |
| Human review / queues in UI | Use the Arize app; ensure configs exist — no `ax` annotation-queue CLI yet |
| Queue not found | `ax annotation-queues list --space SPACE`; verify the queue name or ID |
| Record not appearing in queue | Ensure the annotation config linked to the queue exists; check `ax annotation-configs list --space SPACE` |
| Span SDK errors or missing spans | Confirm `project_name`, `space_id`, and span IDs; use arize-trace to export spans |
---

View File

@@ -54,7 +54,7 @@ ax profiles create work --api-key $ARIZE_API_KEY --region us-east-1b
To use a named profile with any `ax` command, add `-p NAME`:
```bash
ax spans export PROJECT_ID -p work
ax spans export PROJECT -p work
```
## 4. Getting the API key
@@ -81,19 +81,19 @@ ax profiles show
Confirm the API key and region are correct, then retry the original command.
## Space ID
## Space
There is no profile flag for space ID. Save it as an environment variable:
There is no profile flag for space. Save it as an environment variable — accepts a space **name** (e.g., `my-workspace`) or a base64 space **ID** (e.g., `U3BhY2U6...`). Find yours with `ax spaces list -o json`.
**macOS/Linux** — add to `~/.zshrc` or `~/.bashrc`:
```bash
export ARIZE_SPACE_ID="U3BhY2U6..."
export ARIZE_SPACE="my-workspace" # name or base64 ID
```
Then `source ~/.zshrc` (or restart terminal).
**Windows (PowerShell):**
```powershell
[System.Environment]::SetEnvironmentVariable('ARIZE_SPACE_ID', 'U3BhY2U6...', 'User')
[System.Environment]::SetEnvironmentVariable('ARIZE_SPACE', 'my-workspace', 'User')
```
Restart terminal for it to take effect.
@@ -103,8 +103,8 @@ At the **end of the session**, if the user manually provided any credentials dur
**Skip this entirely if:**
- The API key was already loaded from an existing profile or `ARIZE_API_KEY` env var
- The space ID was already set via `ARIZE_SPACE_ID` env var
- The user only used base64 project IDs (no space ID was needed)
- The space was already set via `ARIZE_SPACE` env var
- The user only used base64 project IDs (no space was needed)
**How to offer:** Use **AskQuestion**: *"Would you like to save your Arize credentials so you don't have to enter them next time?"* with options `"Yes, save them"` / `"No thanks"`.
@@ -112,4 +112,4 @@ At the **end of the session**, if the user manually provided any credentials dur
1. **API key** — Run `ax profiles show` to check the current state. Then run `ax profiles create --api-key $ARIZE_API_KEY` or `ax profiles update --api-key $ARIZE_API_KEY` (the key must already be exported as an env var — never pass a raw key value).
2. **Space ID** — See the Space ID section above to persist it as an environment variable.
2. **Space** — See the Space section above to persist it as an environment variable.

View File

@@ -4,7 +4,7 @@ Consult this only when an `ax` command fails. Do NOT run these checks proactivel
## Check version first
If `ax` is installed (not `command not found`), always run `ax --version` before investigating further. The version must be `0.8.0` or higher — many errors are caused by an outdated install. If the version is too old, see **Version too old** below.
If `ax` is installed (not `command not found`), always run `ax --version` before investigating further. The version must be `0.14.0` or higher — many errors are caused by an outdated install. If the version is too old, see **Version too old** below.
## `ax: command not found`
@@ -19,7 +19,7 @@ If `ax` is installed (not `command not found`), always run `ax --version` before
3. Install: `pip install arize-ax-cli`
4. Add to PATH: `$env:PATH = "$env:APPDATA\Python\Scripts;$env:PATH"`
## Version too old (below 0.8.0)
## Version too old (below 0.14.0)
Upgrade: `uv tool install --force --reinstall arize-ax-cli`, `pipx upgrade arize-ax-cli`, or `pip install --upgrade arize-ax-cli`