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

Function extract_response_text

gemini_web2api/gemini.py:182–189  ·  view source on GitHub ↗

Parse full response to get final text.

(raw: str)

Source from the content-addressed store, hash-verified

180
181
182def extract_response_text(raw: str) -> str:
183 """Parse full response to get final text."""
184 last_text = ""
185 for line in raw.split("\n"):
186 for t in _extract_texts_from_line(line):
187 if len(t) > len(last_text):
188 last_text = t
189 return clean_text(last_text)
190
191
192def generate(prompt: str, model_id: int, think_mode: int, file_refs: list = None, extra_fields: dict = None) -> str:

Callers 1

generateFunction · 0.70

Calls 2

_extract_texts_from_lineFunction · 0.85
clean_textFunction · 0.85

Tested by

no test coverage detected