MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / ChunkCapture

Class ChunkCapture

AskAgent/python/webserver/mcp_wrapper.py:322–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321 # Create a wrapper class that provides write_stream method
322 class ChunkCapture:
323 async def write_stream(self, data, end_response=False):
324 # Convert data to string
325 if isinstance(data, dict):
326 chunk = json.dumps(data)
327 elif isinstance(data, bytes):
328 chunk = data.decode('utf-8')
329 else:
330 chunk = str(data)
331 response_content.append(chunk)
332
333 capture_chunk = ChunkCapture()
334

Callers 1

handle_tools_callMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected