Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

The annotationconfigs client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
An annotation config defines the shape of human annotations attached to spans or dataset examples. Each config is one of three types: categorical (a fixed set of labels), continuous (a numeric score range), or freeform (open text). The Get and Delete methods accept either a config name or an ID — when a name is passed, the parent Space (name or ID) is also required.

List Annotation Configs

List returns a paginated list of annotation configs. Space, when non-empty, filters configs to a single space. Signature:
func (c *Client) List(ctx context.Context, req ListRequest) (*AnnotationConfigList, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/annotationconfigs"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    resp, err := client.AnnotationConfigs.List(context.Background(), annotationconfigs.ListRequest{
        Space: "your-space-name-or-id",
        Limit: 25,
    })
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, ac := range resp.AnnotationConfigs {
        if d, err := ac.Discriminator(); err == nil {
            fmt.Printf("annotation config (type=%s)\n", d)
        }
    }
}

Get an Annotation Config

Get returns a single annotation config, resolving by name or ID. The returned AnnotationConfig is a discriminated union — use annotationconfigs.AsCategorical, AsContinuous, or AsFreeform to extract the typed variant. Signature:
func (c *Client) Get(ctx context.Context, req GetRequest) (*AnnotationConfig, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/annotationconfigs"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    ac, err := client.AnnotationConfigs.Get(
        context.Background(),
        annotationconfigs.GetRequest{
            AnnotationConfig: "your-config-name-or-id",
            Space:            "your-space-name-or-id",
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("annotation config not found: %v", notFound)
        }
        log.Fatal(err)
    }

    if cat, ok := annotationconfigs.AsCategorical(*ac); ok {
        fmt.Printf("categorical %s with %d values\n", cat.Name, len(cat.Values))
    }
}

Create an Annotation Config

Create creates a new annotation config, resolving the parent space by name or ID. The annotation config body is a discriminated union — set Type to one of AnnotationConfigTypeCategorical, AnnotationConfigTypeContinuous, or AnnotationConfigTypeFreeform, then fill the matching type-specific fields:
  • Categorical: Values is required.
  • Continuous: MinimumScore and MaximumScore are required.
  • Freeform: no extra fields.
Signature:
func (c *Client) Create(ctx context.Context, req CreateRequest) (*AnnotationConfig, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/annotationconfigs"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    ac, err := client.AnnotationConfigs.Create(
        context.Background(),
        annotationconfigs.CreateRequest{
            Space: "your-space-name-or-id",
            Name:  "quality",
            Type:  annotationconfigs.AnnotationConfigTypeCategorical,
            Values: []annotationconfigs.CategoricalAnnotationValue{
                {Label: "correct"},
                {Label: "incorrect"},
            },
        },
    )
    if err != nil {
        var conflict *arize.ConflictError
        if errors.As(err, &conflict) {
            log.Fatalf("annotation config already exists: %v", conflict)
        }
        log.Fatal(err)
    }

    if cat, ok := annotationconfigs.AsCategorical(*ac); ok {
        fmt.Printf("created annotation config %s\n", cat.Name)
    }
}

Delete an Annotation Config

Delete removes an annotation config, resolving by name or ID. It returns only an error. Signature:
func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
Usage Example:
package main

import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/annotationconfigs"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    err = client.AnnotationConfigs.Delete(
        context.Background(),
        annotationconfigs.DeleteRequest{
            AnnotationConfig: "your-config-name-or-id",
            Space:            "your-space-name-or-id",
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Printf("no annotation config to remove: %v", notFound)
            return
        }
        log.Fatal(err)
    }
}