MCPcopy
hub / github.com/Sophomoresty/gemini-web2api / clean_gemini_text

Function clean_gemini_text

gemini_web2api.py:311–317  ·  view source on GitHub ↗

Remove internal code execution artifacts.

(text: str)

Source from the content-addressed store, hash-verified

309
310
311def clean_gemini_text(text: str) -> str:
312 """Remove internal code execution artifacts."""
313 text = re.sub(
314 r'```(?:python|javascript|text)\?code_(?:reference|stdout)&code_event_index=\d+\n.*?```\n?',
315 '', text, flags=re.DOTALL
316 )
317 return text.strip()
318
319
320def extract_response_text(raw: str) -> str:

Callers 2

extract_response_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected