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

Function generate_json_chunks

api_utils/request_processor.py:465–470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

463 )
464
465 async def generate_json_chunks():
466 chunk_size = 8192 # 8KB chunks
467 for i in range(0, len(response_json_str), chunk_size):
468 chunk = response_json_str[i : i + chunk_size]
469 yield chunk
470 await asyncio.sleep(0.01)
471
472 result_future.set_result(
473 StreamingResponse(

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected