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)
| 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): |
no test coverage detected