@@ -67,7 +67,7 @@ async def _get_reference_id_by_speaker(self, speaker: str) -> str:
67
67
"""
68
68
request_api = "https://api.fish.audio/model"
69
69
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 :
71
71
for sort_by in sort_options :
72
72
params = {"title" : speaker , "sort_by" : sort_by }
73
73
response = await client .get (
@@ -145,7 +145,7 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
145
145
self .headers ["content-type" ] = "application/msgpack"
146
146
try :
147
147
async with (
148
- AsyncClient (proxies = self .proxy ) as client ,
148
+ AsyncClient (proxy = self .proxy ) as client ,
149
149
client .stream (
150
150
"POST" ,
151
151
self .url ,
@@ -168,7 +168,7 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
168
168
else :
169
169
self .headers ["content-type" ] = "application/json"
170
170
try :
171
- async with AsyncClient (proxies = self .proxy ) as client :
171
+ async with AsyncClient (proxy = self .proxy ) as client :
172
172
response = await client .post (
173
173
self .url ,
174
174
headers = self .headers ,
@@ -192,7 +192,7 @@ async def get_balance(self) -> float:
192
192
获取账户余额
193
193
"""
194
194
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 :
196
196
response = await client .get (balance_url , headers = self .headers )
197
197
try :
198
198
return response .json ()["credit" ]
0 commit comments