SelfInstructGenerator
init
- seed_dataset (StaticDataset): Dataset containing seed instructions.
- verifier (BaseVerifier): Verifier instance to validate generated solutions.
- instruction_agent (Optional[ChatAgent]): Agent for generating instructions. If not provided, a default agent will be created.
- rationale_agent (Optional[ChatAgent]): Agent for generating rationales. If not provided, a default agent will be created.
- seed (int): Random seed for reproducibility. (default: :obj:
42
) **kwargs: Additional keyword arguments passed to the BaseGenerator. (default: 42)
default_instruction_agent
default_rationale_agent
format_support_block
- dp (DataPoint): A data point.
generate_new_instruction
- agent (ChatAgent): The agent to use for generating the instruction.
- support_human_dps (list[DataPoint]): List of human examples to sample.
- support_machine_dps (list[DataPoint]): List of machine examples to sample.
generate_rationale
- question (str): The question to be solved.
- agent (Optional[ChatAgent]): The agent to use for generating the rationale. If None is provided, the default rationale agent will be used. (default: :obj:
None
) - support_human_dps (Optional[list[DataPoint]]): List of human examples to sample. (default: :obj:
None
)
QuestionSchema
- question (str): The question generated by the model.
RationaleSchema
- code (str): The generated code without any formatting.