Documentation
¶
Overview ¶
Package training provides utilities for exporting session data into training-ready formats (ShareGPT, OpenAI fine-tuning JSONL, Alpaca).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlpacaExample ¶
type AlpacaExample struct {
Instruction string `json:"instruction"`
Input string `json:"input"`
Output string `json:"output"`
}
AlpacaExample is one training example in Alpaca format.
type ExportOptions ¶
type ExportOptions struct {
// Format is one of "sharegpt", "openai", "alpaca".
Format string
// Output is the destination file path.
Output string
// All, when true, exports sessions from every directory scope.
All bool
// MinTurns is the minimum number of user+assistant exchanges required.
MinTurns int
// MinActions is the minimum number of TaskActions required.
MinActions int
// NoToolResults, when true, replaces tool-result messages with short
// placeholders instead of including the raw content.
NoToolResults bool
// IncludeSystem includes system-prompt messages in the output.
IncludeSystem bool
// Session, when non-empty, exports only the session with this ID.
Session string
}
ExportOptions configures what sessions to export and how to format them.
type ExportResult ¶
type ExportResult struct {
SessionsScanned int `json:"sessions_scanned"`
SessionsExported int `json:"sessions_exported"`
ExamplesGenerated int `json:"examples_generated"`
SessionsFiltered int `json:"sessions_filtered"`
OutputPath string `json:"output_path"`
}
ExportResult contains statistics about an export run.
func ExportSessions ¶
func ExportSessions(opts ExportOptions) (*ExportResult, error)
ExportSessions reads sessions according to opts and writes the result to opts.Output. It returns a summary of the operation.
type OpenAIMessage ¶
OpenAIMessage is a single message within an OpenAI training example.
type OpenAITrainingExample ¶
type OpenAITrainingExample struct {
Messages []OpenAIMessage `json:"messages"`
}
OpenAITrainingExample is one training example for OpenAI fine-tuning JSONL.
type ShareGPTConversation ¶
type ShareGPTConversation struct {
}
ShareGPTConversation represents one conversation in ShareGPT format.
type ShareGPTMessage ¶
type ShareGPTMessage struct {
}
ShareGPTMessage is a single message in a ShareGPT conversation.
type ShareGPTMetadata ¶
type ShareGPTMetadata struct {
}
ShareGPTMetadata holds extra information about a ShareGPT conversation.