types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentHealthStatus

type AgentHealthStatus string

AgentHealthStatus represents health check status

const (
	HealthStatusHealthy  AgentHealthStatus = "healthy"
	HealthStatusStale    AgentHealthStatus = "stale"
	HealthStatusInactive AgentHealthStatus = "inactive"
)

type AgentListItem

type AgentListItem struct {
	ID            string            `json:"id"`
	Hostname      string            `json:"hostname"`
	OSType        string            `json:"os_type"`
	OSInfo        string            `json:"os_info"`
	OSVersion     string            `json:"os_version"`
	Version       string            `json:"version"`
	Status        AgentStatus       `json:"status"`
	Health        AgentHealthStatus `json:"health"`
	LastSeen      *time.Time        `json:"last_seen"`
	Created       time.Time         `json:"created"`
	KernelVersion string            `json:"kernel_version"`
	Arch          string            `json:"arch"`
}

AgentListItem - single agent in list

type AgentPatchPayload

type AgentPatchPayload struct {
	OperationID string `json:"operation_id"`
	Mode        string `json:"mode"` // dry-run or apply
	ScriptURL   string `json:"script_url"`
	ScriptArgs  string `json:"script_args"`
	Timestamp   string `json:"timestamp"`
}

AgentPatchPayload is sent to agent via realtime for execution

type AgentPatchResult

type AgentPatchResult struct {
	OperationID string             `json:"operation_id"`
	Success     bool               `json:"success"`
	OutputPath  string             `json:"output_path"` // Where agent stored output
	ErrorMsg    string             `json:"error_msg"`
	PackageList []PatchPackageInfo `json:"package_list"` // Packages that were changed
	Duration    int64              `json:"duration_ms"`
	Timestamp   string             `json:"timestamp"`
}

AgentPatchResult is received from agent after execution

type AgentStatus

type AgentStatus string

AgentStatus represents the current status of an agent

const (
	AgentStatusActive   AgentStatus = "active"
	AgentStatusInactive AgentStatus = "inactive"
	AgentStatusRevoked  AgentStatus = "revoked"
)

type AuthorizeRequest

type AuthorizeRequest struct {
	Action   string `json:"action"`    // "authorize"
	UserCode string `json:"user_code"` // 8-char code
}

AuthorizeRequest - user authorizes device code

type AuthorizeResponse

type AuthorizeResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

AuthorizeResponse - confirmation of authorization

type ChatMessage

type ChatMessage struct {
	Role    string `json:"role"` // user, assistant, system
	Content string `json:"content"`
}

ChatMessage for TensorZero conversation

type Choice

type Choice struct {
	Index        int         `json:"index"`
	Message      ChatMessage `json:"message"`
	FinishReason string      `json:"finish_reason"`
}

Choice is TensorZero's completion choice (deprecated: use TensorZeroChoice)

type ClickHouseInference

type ClickHouseInference struct {
	ID               string      `json:"id"`
	FunctionName     string      `json:"function_name"`
	VariantName      string      `json:"variant_name"`
	Timestamp        time.Time   `json:"timestamp"`
	ProcessingTimeMs int64       `json:"processing_time_ms"`
	Input            interface{} `json:"input"`
	Output           interface{} `json:"output"`
	Usage            interface{} `json:"usage"` // Token usage
}

ClickHouseInference represents inference data from TensorZero's ClickHouse

type DeviceAuthRequest

type DeviceAuthRequest struct {
	Action string `json:"action"` // "device-auth-start"
}

DeviceAuthRequest - anonymous device auth start

type DeviceAuthResponse

type DeviceAuthResponse struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURI string `json:"verification_uri"`
	ExpiresIn       int    `json:"expires_in"` // seconds
}

DeviceAuthResponse - response with device & user codes

type DiagnosticResponse

type DiagnosticResponse struct {
	ResponseType string        `json:"response_type"` // "diagnostic"
	Reasoning    string        `json:"reasoning"`     // Diagnostic reasoning
	Commands     []string      `json:"commands"`      // Shell commands to run
	EBPFPrograms []EBPFProgram `json:"ebpf_programs"` // eBPF tracing programs
}

DiagnosticResponse is parsed from TensorZeroMessage.Content This is the JSON content within the assistant's message

type EBPFProgram

type EBPFProgram struct {
	Name        string                 `json:"name"`        // Program name
	Code        string                 `json:"code"`        // Program code/script
	Type        string                 `json:"type"`        // "bpftrace"
	Target      string                 `json:"target"`      // bpftrace script/target
	Duration    int                    `json:"duration"`    // Duration in seconds
	Filters     map[string]interface{} `json:"filters"`     // Optional filters
	Description string                 `json:"description"` // Program description
}

EBPFProgram represents an eBPF program to run

type EpisodeData

type EpisodeData struct {
	ID                    string    `json:"id"`
	InferenceCount        int       `json:"inference_count"`
	FirstInferenceTime    time.Time `json:"first_inference_time"`
	LastInferenceTime     time.Time `json:"last_inference_time"`
	FunctionsUsed         []string  `json:"functions_used"`
	TotalProcessingTimeMs int64     `json:"total_processing_time_ms"`
}

EpisodeData represents TensorZero episode information

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse - standard error response

type Feedback

type Feedback struct {
	ID         string      `json:"id"`
	MetricName string      `json:"metric_name"`
	Value      interface{} `json:"value"`
	Timestamp  time.Time   `json:"timestamp"`
}

Feedback represents user feedback for an inference from ClickHouse

type FilesystemStats

type FilesystemStats struct {
	Device       string  `json:"device"`     // e.g., "/dev/sda1"
	MountPath    string  `json:"mount_path"` // e.g., "/"
	UsedGB       float64 `json:"used_gb"`
	FreeGB       float64 `json:"free_gb"`
	TotalGB      float64 `json:"total_gb"`
	UsagePercent float64 `json:"usage_percent"` // Used / Total * 100
}

FilesystemStats contains filesystem information

type HealthRequest

type HealthRequest struct {
	Action  string `json:"action"`   // "health"
	AgentID string `json:"agent_id"` // Agent to check
}

HealthRequest - get agent health & latest metrics

type HealthResponse

type HealthResponse struct {
	AgentID       string            `json:"agent_id"`
	Status        AgentStatus       `json:"status"`
	Health        AgentHealthStatus `json:"health"`
	LastSeen      *time.Time        `json:"last_seen"`
	LatestMetrics *SystemMetrics    `json:"latest_metrics"` // nil if no metrics
}

HealthResponse - agent health status with metrics

type InferenceData

type InferenceData struct {
	ID               string                 `json:"id"`
	FunctionName     string                 `json:"function_name"`
	VariantName      string                 `json:"variant_name"`
	EpisodeID        string                 `json:"episode_id"`
	Input            map[string]interface{} `json:"input"`
	Output           []OutputMessage        `json:"output"`
	ProcessingTimeMs int64                  `json:"processing_time_ms"`
	Timestamp        time.Time              `json:"timestamp"`
	ModelInferences  []ModelInference       `json:"model_inferences"`
}

InferenceData represents TensorZero inference details

type InferenceDetailsResponse

type InferenceDetailsResponse struct {
	ID               string           `json:"id"`
	FunctionName     string           `json:"function_name"`
	VariantName      string           `json:"variant_name"`
	EpisodeID        string           `json:"episode_id"`
	Input            string           `json:"input"`  // User input to function
	Output           string           `json:"output"` // Function output
	ProcessingTimeMs int64            `json:"processing_time_ms"`
	Timestamp        time.Time        `json:"timestamp"`
	ModelInferences  []ModelInference `json:"model_inferences"` // Related LLM calls
	Feedback         []Feedback       `json:"feedback"`         // User feedback from ClickHouse
}

InferenceDetailsResponse enriched inference with model info

type IngestMetricsRequest

type IngestMetricsRequest struct {
	Action        string        `json:"action"`         // "ingest-metrics"
	SystemMetrics SystemMetrics `json:"system_metrics"` // System metrics (new format)

	// Agent metadata updates
	OSInfo        string   `json:"os_info,omitempty"`
	OSVersion     string   `json:"os_version,omitempty"`
	Version       string   `json:"version,omitempty"`
	PrimaryIP     string   `json:"primary_ip,omitempty"`
	KernelVersion string   `json:"kernel_version,omitempty"`
	KernelFamily  string   `json:"platform_family,omitempty"`
	Arch          string   `json:"arch,omitempty"`
	AllIPs        []string `json:"all_ips,omitempty"`
}

IngestMetricsRequest - agent sends metrics every 30s

type IngestMetricsResponse

type IngestMetricsResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

IngestMetricsResponse - confirmation

type Investigation

type Investigation struct {
	ID             string                 `json:"id" db:"id"`                           // PocketBase generated UUID
	UserID         string                 `json:"user_id" db:"user_id"`                 // Investigation owner
	AgentID        string                 `json:"agent_id" db:"agent_id"`               // Agent being investigated
	EpisodeID      string                 `json:"episode_id" db:"episode_id"`           // TensorZero episode reference
	UserPrompt     string                 `json:"user_prompt" db:"user_prompt"`         // Initial user issue description
	Priority       string                 `json:"priority" db:"priority"`               // Priority level: low, medium, high
	Status         InvestigationStatus    `json:"status" db:"status"`                   // Investigation lifecycle status
	ResolutionPlan string                 `json:"resolution_plan" db:"resolution_plan"` // AI-generated resolution from TensorZero
	InitiatedAt    time.Time              `json:"initiated_at" db:"initiated_at"`       // When investigation started
	CompletedAt    *time.Time             `json:"completed_at" db:"completed_at"`       // When investigation completed (nil if ongoing)
	CreatedAt      time.Time              `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time              `json:"updated_at" db:"updated_at"`
	Metadata       map[string]interface{} `json:"metadata" db:"metadata"` // Additional investigation context
}

Investigation represents a system investigation record Stores user prompt + episode_id, fetches inferences from ClickHouse via episode_id

type InvestigationListResponse

type InvestigationListResponse struct {
	ID             string              `json:"id"`
	AgentID        string              `json:"agent_id"`
	UserPrompt     string              `json:"user_prompt"`
	Priority       string              `json:"priority"`
	Status         InvestigationStatus `json:"status"`
	InitiatedAt    time.Time           `json:"initiated_at"`
	CompletedAt    *time.Time          `json:"completed_at"`
	CreatedAt      time.Time           `json:"created_at"`
	InferenceCount int                 `json:"inference_count"` // Count from ClickHouse
}

InvestigationListResponse for listing user's investigations

type InvestigationRequest

type InvestigationRequest struct {
	AgentID  string `json:"agent_id" validate:"required,uuid4"`
	Issue    string `json:"issue" validate:"required,min=10,max=2000"`
	Priority string `json:"priority" validate:"omitempty,oneof=low medium high"` // Defaults to medium
}

InvestigationRequest is sent by frontend to initiate investigation

type InvestigationResponse

type InvestigationResponse struct {
	ID             string                 `json:"id"`
	UserID         string                 `json:"user_id"`
	AgentID        string                 `json:"agent_id"`
	EpisodeID      string                 `json:"episode_id"`
	UserPrompt     string                 `json:"user_prompt"`
	Priority       string                 `json:"priority"`
	Status         InvestigationStatus    `json:"status"`
	ResolutionPlan string                 `json:"resolution_plan"` // AI-generated resolution from TensorZero
	InitiatedAt    time.Time              `json:"initiated_at"`
	CompletedAt    *time.Time             `json:"completed_at"`
	CreatedAt      time.Time              `json:"created_at"`
	UpdatedAt      time.Time              `json:"updated_at"`
	Metadata       map[string]interface{} `json:"metadata"`
	InferenceCount int                    `json:"inference_count"` // Count from ClickHouse
}

InvestigationResponse is returned when investigation is created or retrieved

type InvestigationStatus

type InvestigationStatus string

InvestigationStatus represents investigation workflow state

const (
	InvestigationStatusPending    InvestigationStatus = "pending"
	InvestigationStatusInProgress InvestigationStatus = "in_progress"
	InvestigationStatusCompleted  InvestigationStatus = "completed"
	InvestigationStatusFailed     InvestigationStatus = "failed"
)

type ListAgentsRequest

type ListAgentsRequest struct {
	Action string `json:"action"` // "list"
}

ListAgentsRequest - list user's agents

type ListAgentsResponse

type ListAgentsResponse struct {
	Agents []AgentListItem `json:"agents"`
}

ListAgentsResponse - list of agents

type LoadAverage

type LoadAverage struct {
	OneMin     float64 `json:"one_min"`     // 1 minute load average
	FiveMin    float64 `json:"five_min"`    // 5 minute load average
	FifteenMin float64 `json:"fifteen_min"` // 15 minute load average
}

LoadAverage contains load average metrics

type ModelInference

type ModelInference struct {
	ID               string `json:"id"`
	ModelName        string `json:"model_name"`     // e.g., "gpt-4o"
	ModelProvider    string `json:"model_provider"` // e.g., "openai"
	InputTokens      int    `json:"input_tokens"`
	OutputTokens     int    `json:"output_tokens"`
	ResponseTimeMs   int64  `json:"response_time_ms"`
	TimeToFirstToken int64  `json:"ttft_ms"`
}

ModelInference represents an LLM call within an inference

type NetworkStats

type NetworkStats struct {
	InGB  float64 `json:"in_gb"`
	OutGB float64 `json:"out_gb"`
}

NetworkStats contains network metrics in GB

type OutputMessage

type OutputMessage struct {
	Type string `json:"type"` // text, json, etc
	Text string `json:"text"`
}

OutputMessage represents output from an inference

type PackageUpdate

type PackageUpdate struct {
	ID            string    `json:"id" db:"id"`                           // PocketBase generated UUID
	PatchOpID     string    `json:"patch_op_id" db:"patch_op_id"`         // Reference to patch operation
	PackageName   string    `json:"package_name" db:"package_name"`       // Package name
	CurrentVer    string    `json:"current_ver" db:"current_ver"`         // Current installed version
	TargetVer     string    `json:"target_ver" db:"target_ver"`           // Version to update to (or empty if removal)
	UpdateType    string    `json:"update_type" db:"update_type"`         // install, update, remove
	Status        string    `json:"status" db:"status"`                   // pending, applied, failed
	DryRunResults string    `json:"dry_run_results" db:"dry_run_results"` // Dry-run simulation result
	CreatedAt     time.Time `json:"created_at" db:"created_at"`
	UpdatedAt     time.Time `json:"updated_at" db:"updated_at"`
}

PackageUpdate represents a package that was updated/needs updating

type PatchMode

type PatchMode string

PatchMode represents patch operation mode

const (
	PatchModeDryRun PatchMode = "dry-run"
	PatchModeApply  PatchMode = "apply"
)

type PatchOperation

type PatchOperation struct {
	ID          string      `json:"id" db:"id"`                   // PocketBase generated UUID
	UserID      string      `json:"user_id" db:"user_id"`         // Operation initiator
	AgentID     string      `json:"agent_id" db:"agent_id"`       // Target agent
	Mode        PatchMode   `json:"mode" db:"mode"`               // dry-run or apply
	Status      PatchStatus `json:"status" db:"status"`           // Operation status
	ScriptURL   string      `json:"script_url" db:"script_url"`   // Reference to script in storage
	OutputPath  string      `json:"output_path" db:"output_path"` // Path in storage for output
	ErrorMsg    string      `json:"error_msg" db:"error_msg"`     // Error if failed (empty if success)
	StartedAt   *time.Time  `json:"started_at" db:"started_at"`
	CompletedAt *time.Time  `json:"completed_at" db:"completed_at"`
	CreatedAt   time.Time   `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at" db:"updated_at"`
}

PatchOperation represents a patch operation record Scripts/outputs are NOT stored in database, only references

type PatchPackageInfo

type PatchPackageInfo struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	UpdateType string `json:"update_type"` // install, update, remove
	Details    string `json:"details"`
}

PatchPackageInfo represents package info from agent response

type PatchRequest

type PatchRequest struct {
	AgentID    string `json:"agent_id" validate:"required,uuid4"`
	LxcID      string `json:"lxc_id" validate:"omitempty"` // Optional, for patching LXC containers
	Mode       string `json:"mode" validate:"required,oneof=dry-run apply"`
	ScriptURL  string `json:"script_url" validate:"omitempty"`  // Optional, resolved by server if empty
	ScriptArgs string `json:"script_args" validate:"omitempty"` // Script arguments passed to execution
}

PatchRequest initiates a patch operation

type PatchResponse

type PatchResponse struct {
	ID           string      `json:"id"`
	UserID       string      `json:"user_id"`
	AgentID      string      `json:"agent_id"`
	Mode         PatchMode   `json:"mode"`
	Status       PatchStatus `json:"status"`
	ScriptURL    string      `json:"script_url"`
	ScriptSHA256 string      `json:"script_sha256,omitempty"` // SHA256 of the script
	CreatedAt    time.Time   `json:"created_at"`
	UpdatedAt    time.Time   `json:"updated_at"`
}

PatchResponse returned when operation is created

type PatchStatus

type PatchStatus string

PatchStatus represents patch operation lifecycle

const (
	PatchStatusPending    PatchStatus = "pending"
	PatchStatusRunning    PatchStatus = "running"
	PatchStatusCompleted  PatchStatus = "completed"
	PatchStatusFailed     PatchStatus = "failed"
	PatchStatusRolledBack PatchStatus = "rolled_back"
)

type ProxmoxCluster added in v0.0.2

type ProxmoxCluster struct {
	ID          string `json:"id,omitempty" db:"id"`
	ClusterName string `json:"name" db:"cluster_name"`
	Nodes       int    `json:"nodes" db:"nodes"`
	Quorate     int    `json:"quorate" db:"quorate"`
	Version     int    `json:"version" db:"version"`
	ClusterID   string `json:"px_cluster_id" db:"px_cluster_id"`
}

ProxmoxCluster represents the data structure for a Proxmox cluster. Ingestion is based on `pvesh get /cluster/status --output-format json`

type ProxmoxLXC added in v0.0.2

type ProxmoxLXC struct {
	ID        string `json:"id,omitempty" db:"id"`
	AgentID   string `json:"agent_id" db:"agent_id"`
	ClusterID string `json:"cluster_id,omitempty" db:"cluster_id"`
	NodeID    string `json:"node_id" db:"node_id"`
	Name      string `json:"name" db:"name"`
	LXCID     string `json:"lxc_id" db:"lxc_id"` // from 'id' field in resources
	Status    string `json:"status" db:"status"`
	OSType    string `json:"ostype" db:"ostype"`
	Uptime    int    `json:"uptime" db:"uptime"`
	VMID      int    `json:"vmid" db:"vmid"`
	Node      string `json:"node"` // Used for matching
}

ProxmoxLXC represents a Linux Container in Proxmox. Ingestion is based on `pvesh get /cluster/resources --output-format json` and `pvesh get /nodes/{node}/lxc/{vmid}/config --output-format json`

type ProxmoxNode added in v0.0.2

type ProxmoxNode struct {
	ID         string `json:"id,omitempty" db:"id"`
	AgentID    string `json:"agent_id" db:"agent_id"`
	ClusterID  string `json:"cluster_id,omitempty" db:"cluster_id"`
	IP         string `json:"ip" db:"ip"`
	Level      string `json:"level" db:"level"`
	Local      int    `json:"local" db:"local"`
	Name       string `json:"name" db:"name"`
	NodeID     int    `json:"nodeid" db:"px_node_id"`
	Online     int    `json:"online" db:"online"`
	PVEVersion string `json:"pveversion" db:"pve_version"`
}

ProxmoxNode represents a node in a Proxmox cluster. Ingestion is based on `pvesh get /cluster/status --output-format json` and `pvesh get /nodes/{node}/status --output-format json`

type ProxmoxQemu added in v0.0.2

type ProxmoxQemu struct {
	ID        string `json:"id,omitempty" db:"id"`
	AgentID   string `json:"agent_id" db:"agent_id"`
	ClusterID string `json:"cluster_id,omitempty" db:"cluster_id"`
	NodeID    string `json:"node_id" db:"node_id"`
	Name      string `json:"name" db:"name"`
	QemuID    string `json:"qemu_id" db:"qemu_id"` // from 'id' field in resources
	Status    string `json:"status" db:"status"`
	OSType    string `json:"ostype" db:"ostype"`
	Uptime    int    `json:"uptime" db:"uptime"`
	VMID      int    `json:"vmid" db:"vmid"`
	VMGenID   string `json:"vmgenid,omitempty" db:"vmgenid"`
	KVM       int    `json:"kvm,omitempty" db:"kvm"`
	Boot      string `json:"boot,omitempty" db:"boot"`
	HostCPU   string `json:"cpu,omitempty" db:"host_cpu"`
	Node      string `json:"node"` // Used for matching
}

ProxmoxQemu represents a QEMU/KVM virtual machine in Proxmox. Ingestion is based on `pvesh get /cluster/resources --output-format json` and `pvesh get /nodes/{node}/qemu/{vmid}/config --output-format json`

type RefreshRequest

type RefreshRequest struct {
	Action       string `json:"action"`        // "refresh"
	RefreshToken string `json:"refresh_token"` // Current refresh token
}

RefreshRequest - refresh access token

type RegisterRequest

type RegisterRequest struct {
	Action         string   `json:"action"`          // "register"
	DeviceCode     string   `json:"device_code"`     // UUID from device-auth-start
	Hostname       string   `json:"hostname"`        // Agent hostname
	OSType         string   `json:"os_type"`         // OS type (linux, darwin, windows)
	OSInfo         string   `json:"os_info"`         // OS info (e.g. "Ubuntu 22.04 LTS")
	OSVersion      string   `json:"os_version"`      // OS version (e.g. "22.04")
	Version        string   `json:"version"`         // Agent version
	PrimaryIP      string   `json:"primary_ip"`      // Primary IP address (WAN/eth0)
	KernelVersion  string   `json:"kernel_version"`  // Kernel version
	Arch           string   `json:"arch"`            // CPU architecture (amd64, arm64)
	AllIPs         []string `json:"all_ips"`         // All IP addresses from all NICs
	PlatformFamily string   `json:"platform_family"` // Platform family (debian, redhat, etc.)
}

RegisterRequest - agent registers with device code

type ResolutionResponse

type ResolutionResponse struct {
	ResponseType   string `json:"response_type"`   // "resolution"
	RootCause      string `json:"root_cause"`      // Root cause analysis
	ResolutionPlan string `json:"resolution_plan"` // Step-by-step resolution plan
	Confidence     string `json:"confidence"`      // "High", "Medium", "Low"
	EBPFEvidence   string `json:"ebpf_evidence"`   // Evidence from eBPF monitoring
}

ResolutionResponse is the final response with resolution plan

type RevokeAgentRequest

type RevokeAgentRequest struct {
	Action  string `json:"action"`   // "revoke"
	AgentID string `json:"agent_id"` // Agent to revoke
}

RevokeAgentRequest - revoke agent access

type RevokeAgentResponse

type RevokeAgentResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

RevokeAgentResponse - confirmation

type SystemMetrics

type SystemMetrics struct {
	CPUPercent       float64           `json:"cpu_percent"`
	CPUCores         int               `json:"cpu_cores"`
	MemoryUsedGB     float64           `json:"memory_used_gb"`
	MemoryTotalGB    float64           `json:"memory_total_gb"`
	MemoryPercent    float64           `json:"memory_percent"` // Computed: used/total*100
	DiskUsedGB       float64           `json:"disk_used_gb"`
	DiskTotalGB      float64           `json:"disk_total_gb"`
	DiskUsagePercent float64           `json:"disk_usage_percent"` // Computed: used/total*100
	Filesystems      []FilesystemStats `json:"filesystems"`        // List of filesystems
	LoadAverage      LoadAverage       `json:"load_average"`
	NetworkStats     NetworkStats      `json:"network_stats"`
}

SystemMetrics contains all system metrics from agent

type TensorZeroChoice

type TensorZeroChoice struct {
	Index        int               `json:"index"`         // Choice index
	FinishReason string            `json:"finish_reason"` // "stop", "length", etc
	Message      TensorZeroMessage `json:"message"`       // Assistant message
}

TensorZeroChoice represents a completion choice from TensorZero

type TensorZeroCoreRequest

type TensorZeroCoreRequest struct {
	Model    TensorZeroModel `json:"model"` // tensorzero::function_name::diagnose_and_heal or diagnose_and_heal_application
	Messages []ChatMessage   `json:"messages"`
}

TensorZeroCoreRequest is sent to TensorZero for AI analysis

type TensorZeroMessage

type TensorZeroMessage struct {
	Role      string        `json:"role"`       // "assistant"
	Content   string        `json:"content"`    // JSON string containing response_type, reasoning, commands, ebpf_programs, etc
	ToolCalls []interface{} `json:"tool_calls"` // Tool calls (if any)
}

TensorZeroMessage represents an assistant message from TensorZero

type TensorZeroModel

type TensorZeroModel string

TensorZeroModel represents the TensorZero model to use

const (
	TensorZeroModelDiagnoseAndHealApplication TensorZeroModel = "tensorzero::function_name::diagnose_and_heal_application"
	TensorZeroModelDiagnoseAndHeal            TensorZeroModel = "tensorzero::function_name::diagnose_and_heal"
)

type TensorZeroResponse

type TensorZeroResponse struct {
	ID                string             `json:"id"`                 // Response ID
	EpisodeID         string             `json:"episode_id"`         // Unique episode identifier
	Choices           []TensorZeroChoice `json:"choices"`            // Completion choices
	Created           int64              `json:"created"`            // Unix timestamp
	Model             string             `json:"model"`              // Model used (e.g., tensorzero::function_name::diagnose_and_heal::variant_name::v1)
	SystemFingerprint string             `json:"system_fingerprint"` // System fingerprint
	ServiceTier       interface{}        `json:"service_tier"`       // Service tier (can be null)
	Object            string             `json:"object"`             // "chat.completion"
	Usage             TokenUsage         `json:"usage"`              // Token usage stats
}

TensorZeroResponse is the complete response from TensorZero Core API Matches: /openai/v1/chat/completions

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int    `json:"expires_in"` // seconds
	AgentID      string `json:"agent_id"`
}

TokenResponse - access & refresh tokens

type TokenUsage

type TokenUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

TokenUsage for TensorZero response

Jump to

Keyboard shortcuts

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