MCPcopy Create free account
hub / github.com/Nativu5/Gemini-FastAPI / flush

Method flush

app/server/chat.py:1075–1087  ·  view source on GitHub ↗

Release remaining buffer content and perform final cleanup at stream end.

(self)

Source from the content-addressed store, hash-verified

1073 return "".join(output)
1074
1075 def flush(self) -> str:
1076 """Release remaining buffer content and perform final cleanup at stream end."""
1077 res = ""
1078 if self._is_outputting():
1079 res = self.buffer
1080 tail_match = STREAM_TAIL_RE.search(res)
1081 if tail_match:
1082 res = res[: -len(tail_match.group(0))]
1083
1084 self.buffer = ""
1085 self.stack = ["NORMAL"]
1086 self.current_role = ""
1087 return strip_system_hints(res)
1088
1089
1090# --- Response Builders & Streaming ---

Callers 1

generate_streamFunction · 0.95

Calls 2

_is_outputtingMethod · 0.95
strip_system_hintsFunction · 0.90

Tested by

no test coverage detected