anttrace

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package anttrace parses and renders Anthropic request trace data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderJSON

func RenderJSON(out io.Writer, report Report) error

func RenderMarkdown

func RenderMarkdown(report Report) string

func RenderText

func RenderText(out io.Writer, report Report)

Types

type Options

type Options struct {
	Provider        string
	Model           string
	BaseURL         string
	AuthConfigured  bool
	RateLimit       anthropic.RateLimitReport
	Message         string
	ReasoningEffort string
	Timeout         time.Duration
	NoRequest       bool
	Client          Streamer
	CreatedAt       time.Time
}

type Report

type Report struct {
	Kind           string                    `json:"kind"`
	Action         string                    `json:"action"`
	Status         string                    `json:"status"`
	Provider       string                    `json:"provider"`
	Model          string                    `json:"model"`
	BaseURL        string                    `json:"base_url"`
	AuthConfigured bool                      `json:"auth_configured"`
	RequestSent    bool                      `json:"request_sent"`
	TimeoutMS      int                       `json:"timeout_ms"`
	ElapsedMS      int64                     `json:"elapsed_ms"`
	StreamEvents   int                       `json:"stream_events"`
	TextPreview    string                    `json:"text_preview,omitempty"`
	Usage          anthropic.Usage           `json:"usage,omitempty"`
	RateLimit      anthropic.RateLimitReport `json:"rate_limit"`
	Error          string                    `json:"error,omitempty"`
	File           string                    `json:"file,omitempty"`
	Bytes          int                       `json:"bytes,omitempty"`
	Messages       []string                  `json:"messages,omitempty"`
	CreatedAt      string                    `json:"created_at,omitempty"`
}

func Run

func Run(ctx context.Context, options Options) Report

type Streamer

type Streamer interface {
	Stream(context.Context, anthropic.Request, func(string)) (anthropic.AssistantMessage, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL