Versions in this module Expand all Collapse all v0 v0.1.1 Jan 17, 2026 v0.1.0 Jan 4, 2026 Changes in this version + const DefaultProjectName + const DefaultURL + const EnvAPIKey + const EnvProjectName + const EnvSpaceID + const EnvURL + const Version + var ErrDatasetNotFound = errors.New("phoenix: dataset not found") + var ErrExperimentNotFound = errors.New("phoenix: experiment not found") + var ErrInvalidInput = errors.New("phoenix: invalid input") + var ErrMissingAPIKey = errors.New("phoenix: missing API key") + var ErrMissingURL = errors.New("phoenix: missing API URL") + var ErrProjectNotFound = errors.New("phoenix: project not found") + var ErrPromptNotFound = errors.New("phoenix: prompt not found") + var ErrSpanNotFound = errors.New("phoenix: span not found") + var ErrTraceNotFound = errors.New("phoenix: trace not found") + func IsForbidden(err error) bool + func IsNotFound(err error) bool + func IsRateLimited(err error) bool + func IsUnauthorized(err error) bool + type APIError struct + Details string + Message string + StatusCode int + func (e *APIError) Error() string + type Annotation struct + CreatedAt time.Time + Explanation string + ID string + Label string + Name string + Score float64 + Source AnnotatorKind + SpanID string + TraceID string + UpdatedAt time.Time + type AnnotationOption func(*annotationOptions) + func WithAnnotationExplanation(explanation string) AnnotationOption + func WithAnnotationLabel(label string) AnnotationOption + func WithAnnotationSource(source AnnotatorKind) AnnotationOption + type AnnotatorKind string + const AnnotatorKindCode + const AnnotatorKindHuman + const AnnotatorKindLLM + type Client struct + func NewClient(opts ...Option) (*Client, error) + func (c *Client) API() *api.Client + func (c *Client) AddDatasetExamples(ctx context.Context, datasetName string, examples []DatasetExample) error + func (c *Client) Config() *Config + func (c *Client) CreateChatPrompt(ctx context.Context, name string, messages []PromptMessage, modelName string, ...) (*PromptVersion, error) + func (c *Client) CreateDataset(ctx context.Context, name string, examples []DatasetExample, ...) (*Dataset, error) + func (c *Client) CreateProject(ctx context.Context, name string, opts ...ProjectOption) (*Project, error) + func (c *Client) CreatePrompt(ctx context.Context, name string, template string, modelName string, ...) (*PromptVersion, error) + func (c *Client) CreateSpanAnnotation(ctx context.Context, spanID, name string, score float64, ...) error + func (c *Client) CreateTraceAnnotation(ctx context.Context, traceID, name string, score float64, ...) error + func (c *Client) DeleteDataset(ctx context.Context, id string) error + func (c *Client) DeleteExperiment(ctx context.Context, experimentID string) error + func (c *Client) DeleteProject(ctx context.Context, identifier string) error + func (c *Client) DeleteSpan(ctx context.Context, spanIdentifier string) error + func (c *Client) DeleteTrace(ctx context.Context, traceIdentifier string) error + func (c *Client) GetDataset(ctx context.Context, id string) (*Dataset, error) + func (c *Client) GetProject(ctx context.Context, identifier string) (*Project, error) + func (c *Client) GetPromptLatest(ctx context.Context, name string) (*PromptVersion, error) + func (c *Client) GetPromptVersion(ctx context.Context, versionID string) (*PromptVersion, error) + func (c *Client) GetPromptVersionByTag(ctx context.Context, promptName, tagName string) (*PromptVersion, error) + func (c *Client) GetSpans(ctx context.Context, projectIdentifier string, opts ...SpanOption) ([]*Span, string, error) + func (c *Client) ListDatasets(ctx context.Context, opts ...ListOption) ([]*Dataset, string, error) + func (c *Client) ListExperiments(ctx context.Context, datasetID string, opts ...ListOption) ([]*Experiment, string, error) + func (c *Client) ListProjects(ctx context.Context, opts ...ListOption) ([]*Project, string, error) + func (c *Client) ListPromptVersions(ctx context.Context, promptName string, opts ...ListOption) ([]*PromptVersion, string, error) + func (c *Client) ListPrompts(ctx context.Context, opts ...ListOption) ([]*Prompt, string, error) + func (c *Client) ListSpanAnnotations(ctx context.Context, spanIDs []string) ([]*Annotation, error) + func (c *Client) ListTraceAnnotations(ctx context.Context, traceIDs []string) ([]*Annotation, error) + func (c *Client) ProjectName() string + func (c *Client) SetProjectName(name string) + type Config struct + APIKey string + ProjectName string + SpaceID string + URL string + func LoadConfig() *Config + func NewConfig() *Config + func (c *Config) BaseURL() string + func (c *Config) Validate() error + type Dataset struct + CreatedAt time.Time + Description string + ExampleCount int + ID string + Name string + UpdatedAt time.Time + type DatasetExample struct + Input any + Metadata map[string]any + Output any + type DatasetOption func(*datasetOptions) + func WithDatasetDescription(desc string) DatasetOption + type Experiment struct + CreatedAt time.Time + DatasetID string + DatasetVersionID string + ExampleCount int + FailedRunCount int + ID string + MissingRunCount int + ProjectName string + Repetitions int + SuccessfulRunCount int + UpdatedAt time.Time + type ListOption func(*listOptions) + func WithCursor(cursor string) ListOption + func WithLimit(limit int) ListOption + type Option func(*clientOptions) + func WithAPIKey(apiKey string) Option + func WithConfig(config *Config) Option + func WithHTTPClient(client *http.Client) Option + func WithProjectName(projectName string) Option + func WithSpaceID(spaceID string) Option + func WithTimeout(timeout time.Duration) Option + func WithURL(url string) Option + type Project struct + CreatedAt time.Time + Description string + ID string + Name string + UpdatedAt time.Time + type ProjectOption func(*projectOptions) + func WithDescription(desc string) ProjectOption + func WithName(name string) ProjectOption + type Prompt struct + Description string + ID string + Name string + SourcePromptID string + type PromptMessage struct + Content string + Role string + type PromptModelProvider string + const PromptModelProviderAWS + const PromptModelProviderAnthropic + const PromptModelProviderAzureOpenAI + const PromptModelProviderDeepseek + const PromptModelProviderGoogle + const PromptModelProviderOllama + const PromptModelProviderOpenAI + const PromptModelProviderXAI + type PromptOption func(*promptOptions) + func WithPromptDescription(desc string) PromptOption + type PromptTemplateType string + const PromptTemplateTypeChat + const PromptTemplateTypeString + type PromptVersion struct + Description string + ID string + ModelName string + ModelProvider PromptModelProvider + Template string + TemplateType PromptTemplateType + type Span struct + EndTime time.Time + ID string + Name string + ParentID string + SpanID string + SpanKind string + StartTime time.Time + StatusCode string + StatusMessage string + TraceID string + type SpanOption func(*spanOptions) + func WithSpanCursor(cursor string) SpanOption + func WithSpanLimit(limit int) SpanOption