MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / reset_for_new_request

Method reset_for_new_request

stream/interceptors.py:50–58  ·  view source on GitHub ↗

Reset interceptor state for a new request. This clears the response buffer and function call accumulation state. Should be called at the start of each new GenerateContent request to ensure clean state.

(self)

Source from the content-addressed store, hash-verified

48 logging.getLogger("http_interceptor").setLevel(logging.WARNING)
49
50 def reset_for_new_request(self) -> None:
51 """Reset interceptor state for a new request.
52
53 This clears the response buffer and function call accumulation state.
54 Should be called at the start of each new GenerateContent request to
55 ensure clean state.
56 """
57 self.response_buffer = ""
58 self._accumulated_function_calls.clear()
59
60 @staticmethod
61 def should_intercept(host: str, path: str):

Callers 1

_process_client_dataMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected