Documentation
¶
Overview ¶
Package testutil provides fixture generators for adapter testing and benchmarking, producing realistic JSONL session files in Claude Code and Codex formats.
Index ¶
- func ApproximateMessageCount(targetSize int64, avgMessageSize int) int
- func GenerateClaudeCodeSessionFile(path string, messageCount int, avgMessageSize int) error
- func GenerateCodexSessionFile(path string, messageCount int, avgMessageSize int) error
- type ClaudeCodeMessage
- type ClaudeCodeMsgContent
- type ClaudeCodeUsage
- type CodexMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproximateMessageCount ¶
ApproximateMessageCount returns the message count to generate a file of approximately the given size. size is in bytes, avgMessageSize is the target size per message pair.
func GenerateClaudeCodeSessionFile ¶
GenerateClaudeCodeSessionFile creates a JSONL file with realistic message content. messageCount determines the number of message pairs (user + assistant). avgMessageSize is the approximate size of message content in bytes.
Types ¶
type ClaudeCodeMessage ¶
type ClaudeCodeMessage struct {
Type string `json:"type"`
UUID string `json:"uuid"`
SessionID string `json:"sessionId"`
Timestamp time.Time `json:"timestamp"`
Message *ClaudeCodeMsgContent `json:"message,omitempty"`
CWD string `json:"cwd,omitempty"`
Version string `json:"version,omitempty"`
}
ClaudeCodeMessage represents a JSONL message in Claude Code format.
type ClaudeCodeMsgContent ¶
type ClaudeCodeMsgContent struct {
Role string `json:"role"`
Content json.RawMessage `json:"content"`
Model string `json:"model,omitempty"`
Usage *ClaudeCodeUsage `json:"usage,omitempty"`
}
ClaudeCodeMsgContent holds the actual message content.
type ClaudeCodeUsage ¶
type ClaudeCodeUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
}
ClaudeCodeUsage tracks token usage.
type CodexMessage ¶
type CodexMessage struct {
Type string `json:"type"`
SessionID string `json:"session_id,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
Role string `json:"role,omitempty"`
Content string `json:"content,omitempty"`
Model string `json:"model,omitempty"`
CallID string `json:"call_id,omitempty"`
Name string `json:"name,omitempty"`
Arguments string `json:"arguments,omitempty"`
Output string `json:"output,omitempty"`
Input int `json:"input,omitempty"`
Output_ int `json:"output_,omitempty"` // for usage
}
CodexMessage represents a JSONL message in Codex format.