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

Function clean_text

gemini_web2api/gemini.py:150–156  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

148
149
150def clean_text(text: str) -> str:
151 text = re.sub(
152 r'```(?:python|javascript|text)\?code_(?:reference|stdout)&code_event_index=\d+\n.*?```\n?',
153 '', text, flags=re.DOTALL
154 )
155 text = re.sub(r'http://googleusercontent\.com/card_content/\d+\n?', '', text)
156 return text.strip()
157
158
159def _extract_texts_from_line(line: str) -> list:

Callers 2

extract_response_textFunction · 0.85
generate_streamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected