export

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package export provides conversation export functionality in multiple formats. ABOUTME: Export interface and dispatcher for conversation exports ABOUTME: Supports multiple export formats (Markdown, JSON, HTML)

Package export provides conversation export functionality in multiple formats. ABOUTME: HTML exporter for conversations with syntax highlighting ABOUTME: Uses Chroma for code block syntax highlighting with color themes

Package export provides conversation export functionality in multiple formats. ABOUTME: JSON exporter for conversations with full structure ABOUTME: Produces complete JSON export suitable for parsing and round-trip

Package export provides conversation export functionality in multiple formats. ABOUTME: Markdown exporter for conversations with frontmatter metadata ABOUTME: Produces clean, readable Markdown with YAML frontmatter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(db *sql.DB, conversationID string, format Format, w io.Writer) error

Export exports a conversation in the specified format

Types

type ConversationData

type ConversationData struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	Model        string `json:"model"`
	SystemPrompt string `json:"system_prompt,omitempty"`
	CreatedAt    string `json:"created_at"`
	UpdatedAt    string `json:"updated_at"`
}

ConversationData represents conversation metadata

type ConversationExport

type ConversationExport struct {
	Conversation ConversationData `json:"conversation"`
	Messages     []MessageData    `json:"messages"`
}

ConversationExport represents the full conversation export structure

type Exporter

type Exporter interface {
	Export(conv *storage.Conversation, messages []*storage.Message, w io.Writer) error
}

Exporter defines the interface for conversation exporters

type Format

type Format string

Format represents an export format

const (
	// FormatMarkdown exports conversations as Markdown with YAML frontmatter
	FormatMarkdown Format = "markdown"
	// FormatJSON exports conversations as structured JSON
	FormatJSON Format = "json"
	// FormatHTML exports conversations as styled HTML
	FormatHTML Format = "html"
)

type HTMLExporter

type HTMLExporter struct{}

HTMLExporter exports conversations as HTML with syntax highlighting

func (*HTMLExporter) Export

func (e *HTMLExporter) Export(conv *storage.Conversation, messages []*storage.Message, w io.Writer) error

Export implements the Exporter interface for HTML format

type JSONExporter

type JSONExporter struct{}

JSONExporter exports conversations as JSON

func (*JSONExporter) Export

func (e *JSONExporter) Export(conv *storage.Conversation, messages []*storage.Message, w io.Writer) error

Export implements the Exporter interface for JSON format

type MarkdownExporter

type MarkdownExporter struct{}

MarkdownExporter exports conversations as Markdown with YAML frontmatter

func (*MarkdownExporter) Export

func (e *MarkdownExporter) Export(conv *storage.Conversation, messages []*storage.Message, w io.Writer) error

Export implements the Exporter interface for Markdown format

type MessageData

type MessageData struct {
	ID             string          `json:"id"`
	ConversationID string          `json:"conversation_id"`
	Role           string          `json:"role"`
	Content        string          `json:"content"`
	ToolCalls      json.RawMessage `json:"tool_calls,omitempty"`
	Metadata       json.RawMessage `json:"metadata,omitempty"`
	CreatedAt      string          `json:"created_at"`
}

MessageData represents a message with metadata

Jump to

Keyboard shortcuts

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