Skip to content

Commit 110f6cb

Browse files
committedNov 28, 2024
2 parents bfcd063 + 5322d46 commit 110f6cb

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed
 

‎.deepsource.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version = 1
2+
3+
[[analyzers]]
4+
name = "python"
5+
6+
[analyzers.meta]
7+
runtime_version = "3.x.x"
8+
9+
[[transformers]]
10+
name = "ruff"

‎nonebot_plugin_fishspeech_tts/fish_audio_api.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,19 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
145145
if request.references:
146146
self.headers["content-type"] = "application/msgpack"
147147
try:
148-
async with AsyncClient(proxies=self.proxy) as client:
149-
async with client.stream(
148+
async with (
149+
AsyncClient(proxies=self.proxy) as client,
150+
client.stream(
150151
"POST",
151152
self.url,
152153
headers=self.headers,
153154
content=ormsgpack.packb(
154155
request, option=ormsgpack.OPT_SERIALIZE_PYDANTIC
155156
),
156157
timeout=60,
157-
) as resp:
158-
return await resp.aread()
158+
) as resp,
159+
):
160+
return await resp.aread()
159161
except (
160162
ReadTimeout,
161163
ConnectTimeout,

0 commit comments

Comments
 (0)