mirror of https://github.com/Mai-with-u/MaiBot.git
先修一个问题
parent
01c52e4caf
commit
f7e155061d
|
|
@ -2,7 +2,7 @@ import asyncio
|
||||||
import io
|
import io
|
||||||
import base64
|
import base64
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from typing import Callable, Iterator, TypeVar, AsyncIterator, Optional, Coroutine, Any, List
|
from typing import Callable, TypeVar, AsyncIterator, Optional, Coroutine, Any, List
|
||||||
|
|
||||||
from google import genai
|
from google import genai
|
||||||
from google.genai import types
|
from google.genai import types
|
||||||
|
|
@ -220,7 +220,7 @@ async def _default_stream_response_handler(
|
||||||
if _fc_delta_buffer and not _fc_delta_buffer.closed:
|
if _fc_delta_buffer and not _fc_delta_buffer.closed:
|
||||||
_fc_delta_buffer.close()
|
_fc_delta_buffer.close()
|
||||||
|
|
||||||
async for chunk in _to_async_iterable(resp_stream):
|
async for chunk in resp_stream:
|
||||||
# 检查是否有中断量
|
# 检查是否有中断量
|
||||||
if interrupt_flag and interrupt_flag.is_set():
|
if interrupt_flag and interrupt_flag.is_set():
|
||||||
# 如果中断量被设置,则抛出ReqAbortException
|
# 如果中断量被设置,则抛出ReqAbortException
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue