Interface: NarratorArgs
Represents the arguments required to create a Narrator instance.
Properties
examplesDir?
optional
examplesDir:string
Directory where example YAML files are stored. (optional)
Defined in
exampleTemplate()?
optional
exampleTemplate: (example
) =>string
Function to format examples. Takes an example object and returns a formatted string. (optional)
Parameters
• example: Example
Returns
string
Defined in
logger?
optional
logger:Logger
Custom logger instance for logging (e.g., Winston logger).
(optional, default is defaultNarratorLogger
)
Defined in
model?
optional
model:any
The model to use for text generation, e.g., a model from the OpenAI API. (optional, default is openai("gpt-4o"))
Defined in
outputDir?
optional
outputDir:string
Directory where generated outputs will be saved. (optional)
Defined in
outputFilename()?
optional
outputFilename: (docId
) =>string
Function to generate output filenames based on the document ID. (optional, default generates filenames from the docId)
Parameters
• docId: string
Returns
string
Defined in
parallel?
optional
parallel:number
Number of parallel processes to use when running generateMulti. (optional, default is 1)
Defined in
temperature?
optional
temperature:number
Temperature for the model generation. Controls randomness in generation. A value closer to 1 results in more randomness, closer to 0 results in more deterministic output. (optional, default is 0.9)
Defined in
trainer?
optional
trainer:Trainer
Trainer instance responsible for evaluating generated examples.
(optional, default is an instance of HumanTrainer
)