Skip to content

Commit 03d863e

Browse files
committedDec 4, 2024
🐛 fix(fish_audio_api): 修复 AsyncClient 的代理参数名称
1 parent dfe5e46 commit 03d863e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎nonebot_plugin_fishspeech_tts/fish_audio_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def _get_reference_id_by_speaker(self, speaker: str) -> str:
6767
"""
6868
request_api = "https://api.fish.audio/model"
6969
sort_options = ["score", "task_count", "created_at"]
70-
async with AsyncClient(proxies=self.proxy) as client:
70+
async with AsyncClient(proxy=self.proxy) as client:
7171
for sort_by in sort_options:
7272
params = {"title": speaker, "sort_by": sort_by}
7373
response = await client.get(
@@ -145,7 +145,7 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
145145
self.headers["content-type"] = "application/msgpack"
146146
try:
147147
async with (
148-
AsyncClient(proxies=self.proxy) as client,
148+
AsyncClient(proxy=self.proxy) as client,
149149
client.stream(
150150
"POST",
151151
self.url,
@@ -168,7 +168,7 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
168168
else:
169169
self.headers["content-type"] = "application/json"
170170
try:
171-
async with AsyncClient(proxies=self.proxy) as client:
171+
async with AsyncClient(proxy=self.proxy) as client:
172172
response = await client.post(
173173
self.url,
174174
headers=self.headers,
@@ -192,7 +192,7 @@ async def get_balance(self) -> float:
192192
获取账户余额
193193
"""
194194
balance_url = "https://api.fish.audio/wallet/self/api-credit"
195-
async with AsyncClient(proxies=self.proxy) as client:
195+
async with AsyncClient(proxy=self.proxy) as client:
196196
response = await client.get(balance_url, headers=self.headers)
197197
try:
198198
return response.json()["credit"]

0 commit comments

Comments
 (0)
Failed to load comments.