Generate step-by-step reasoning paths and synthetic training data for AI models
cot_save
cot_upload_to_huggingface
GenerateCOT
class provides specialized functionality for generating Chain-of-Thought training data from question-answer pairs.
cot_run(question: str) -> str
- Generate solution as stringcot_run_dict(question: str) -> dict
- Generate solution with structured outputcot_generate(question: str, context: str = "") -> str
- Generate with contextcot_generate_dict(question: str, context: str = "") -> dict
- Generate structured with contextcot_check(question: str, answer: str) -> bool
- Verify if answer is correctcot_find_error(question: str, current: str) -> str
- Find errors in solutioncot_improve(question: str, current: str) -> str
- Improve existing solutionFeature | Documentation Shows | Actual Implementation |
---|---|---|
Initialization | topic="Math" | qa_pairs={...} |
Generation | cot_gen.generate() | cot_gen.cot_run(question) |
Question creation | num_questions=5 | Must provide Q&A pairs |
Improvement | cot_improve("Make detailed") | cot_improve(question, current) |