debugtrace

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

func LogLLMRequest

func LogLLMRequest(model string, messageCount int, toolCount int, messages []map[string]string)

LogLLMRequest logs a summary of the LLM request to the debug file.

func LogLLMResponse

func LogLLMResponse(model string, content string, toolCalls []string, finishReason string)

LogLLMResponse logs a summary of the LLM response.

func LogToFile

func LogToFile(category, event string, data map[string]interface{})

LogToFile writes a structured debug entry to /tmp/agently-debug.log. Safe to call concurrently. No-op if the file can't be opened.

func LogToolCall

func LogToolCall(toolName, opID, status string, resultLen int, resultHead string, err string)

LogToolCall logs a tool call execution result.

func Path

func Path() string

func PayloadDir

func PayloadDir() string

func SummarizeMessages

func SummarizeMessages(messages []llm.Message) []map[string]any

func SummarizeMessagesForLog

func SummarizeMessagesForLog(messages interface{}) []map[string]string

SummarizeMessagesForLog creates a compact summary of LLM messages.

func SummarizeToolCalls

func SummarizeToolCalls(calls []llm.ToolCall) []map[string]any

func Write

func Write(component, event string, fields map[string]any)

func WritePayload

func WritePayload(prefix, messageID string, body []byte) string

Types

type Record

type Record struct {
	Time      string         `json:"time"`
	Component string         `json:"component"`
	Event     string         `json:"event"`
	PID       int            `json:"pid"`
	Fields    map[string]any `json:"fields,omitempty"`
}

Jump to

Keyboard shortcuts

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