fix: remove YuyayStreamFilter so pichay can receive yuyay-response blocks
This commit is contained in:
parent
59cce5c6d2
commit
fa1f27bad5
1 changed files with 1 additions and 10 deletions
|
|
@ -2035,7 +2035,6 @@ def create_app(
|
||||||
stream_error = False
|
stream_error = False
|
||||||
sse_buffer = bytearray()
|
sse_buffer = bytearray()
|
||||||
usage: dict[str, Any] = {}
|
usage: dict[str, Any] = {}
|
||||||
yuyay_filter = YuyayStreamFilter()
|
|
||||||
try:
|
try:
|
||||||
with client.stream(
|
with client.stream(
|
||||||
"POST", upstream_path, json=outgoing_body, headers=headers
|
"POST", upstream_path, json=outgoing_body, headers=headers
|
||||||
|
|
@ -2049,7 +2048,6 @@ def create_app(
|
||||||
for chunk in resp.iter_bytes():
|
for chunk in resp.iter_bytes():
|
||||||
bytes_out += len(chunk)
|
bytes_out += len(chunk)
|
||||||
chunk_count += 1
|
chunk_count += 1
|
||||||
# Inspect raw chunk for metrics (before filtering)
|
|
||||||
_inspect_sse_chunk(
|
_inspect_sse_chunk(
|
||||||
chunk,
|
chunk,
|
||||||
buffer=sse_buffer,
|
buffer=sse_buffer,
|
||||||
|
|
@ -2059,14 +2057,7 @@ def create_app(
|
||||||
provider=provider,
|
provider=provider,
|
||||||
usage_accumulator=usage,
|
usage_accumulator=usage,
|
||||||
)
|
)
|
||||||
# Filter yuyay protocol tags before forwarding
|
yield chunk
|
||||||
filtered = yuyay_filter.feed(chunk)
|
|
||||||
if filtered:
|
|
||||||
yield filtered
|
|
||||||
# Flush any remaining buffered bytes
|
|
||||||
tail = yuyay_filter.flush()
|
|
||||||
if tail:
|
|
||||||
yield tail
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
stream_error = True
|
stream_error = True
|
||||||
emit_event(
|
emit_event(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue