export

package
v1.18.8 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package export provides HTML export functionality for cagent sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(data SessionData) (string, error)

Generate creates an HTML string from the session data.

func SessionToFile

func SessionToFile(sess *session.Session, agentDescription, filename string) (string, error)

SessionToFile exports a session to an HTML file. If filename is empty, a default name based on the title and timestamp is used. Returns the absolute path of the created file.

func ToFile

func ToFile(data SessionData, filename string) (string, error)

ToFile exports session data to an HTML file. If filename is empty, a default name based on the title and timestamp is used. Returns the absolute path of the created file.

Types

type Message

type Message struct {
	Role             chat.MessageRole
	Content          string
	ReasoningContent string
	ToolCallID       string
	ToolCalls        []ToolCall
	AgentName        string
	Implicit         bool
}

Message represents a single message in the session.

type SessionData

type SessionData struct {
	Title            string
	AgentDescription string
	CreatedAt        time.Time
	InputTokens      int64
	OutputTokens     int64
	Cost             float64
	Messages         []Message
}

SessionData contains the session information needed for HTML export.

type ToolCall

type ToolCall struct {
	ID        string
	Name      string
	Arguments string
}

ToolCall represents a tool invocation.

Jump to

Keyboard shortcuts

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