MCPcopy Index your code
hub / github.com/TIGER-AI-Lab/TheoremExplainAgent / fix_transcript

Function fix_transcript

eval_suite/text_utils.py:34–51  ·  view source on GitHub ↗

Fix and clean up a transcript using an LLM model. Args: text_eval_model: The LLM model wrapper to use for fixing the transcript. transcript: The input transcript text to fix. Returns: str: The fixed and cleaned transcript text.

(text_eval_model: Union[LiteLLMWrapper, GeminiWrapper], transcript: str)

Source from the content-addressed store, hash-verified

32
33
34def fix_transcript(text_eval_model: Union[LiteLLMWrapper, GeminiWrapper], transcript: str) -> str:
35 """
36 Fix and clean up a transcript using an LLM model.
37
38 Args:
39 text_eval_model: The LLM model wrapper to use for fixing the transcript.
40 transcript: The input transcript text to fix.
41
42 Returns:
43 str: The fixed and cleaned transcript text.
44 """
45 print("Fixing transcript...")
46
47 prompt = _fix_transcript.format(transcript=transcript)
48 response = text_eval_model(_prepare_text_inputs(prompt))
49 fixed_script = response.split("<SCRIPT>", maxsplit=1)[1].split("</SCRIPT>")[0]
50
51 return fixed_script
52
53
54def evaluate_text(text_eval_model: LiteLLMWrapper, transcript: str, retry_limit: int) -> dict:

Callers 1

evaluate_text_fileFunction · 0.90

Calls 1

_prepare_text_inputsFunction · 0.90

Tested by

no test coverage detected