Skip to content

Commit 5775bc5

Browse files
author
赵嘉琦
committed
feat:APIKEY
1 parent 616b652 commit 5775bc5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/integration_tests/test_tts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from zhipuai.api_resource.tts import TTSApi
44

55
# 请根据实际情况填写
6-
BASE_URL_LIST = "https://dev.bigmodel.cn/stage-api/paas"
7-
BASE_URL_ADD = "https://dev.bigmodel.cn/stage-api/paas"
6+
BASE_URL_LIST = "https://dev.bigmodel.cn/stage-api/paas/v4"
7+
BASE_URL_ADD = "https://dev.bigmodel.cn/stage-api/paas/v4"
88
API_KEY = "d91103df5c4a47bb808d4c84bcae9fcf.HCFkuDBhwKWLxliY"
99
AUDIO_FILE_PATH = r"C:\Users\zjq18\Downloads\北京今天的天气.wav"
1010

zhipuai/api_resource/tts/tts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, base_url: str, api_key: Optional[str] = None):
88
self.api_key = api_key
99

1010
def list_voices(self) -> VoiceListResponse:
11-
url = f"{self.base_url}/v4/voice/list"
11+
url = f"{self.base_url}/voice/list"
1212
headers = {}
1313
if self.api_key:
1414
headers["Authorization"] = f"Bearer {self.api_key}"
@@ -18,7 +18,7 @@ def list_voices(self) -> VoiceListResponse:
1818
return VoiceListResponse.parse_obj(resp.json())
1919

2020
def add_voice(self, voice_name: str, voice_text: str, file_path: str) -> VoiceAddResponse:
21-
url = f"{self.base_url}/v4/voice/add"
21+
url = f"{self.base_url}/voice/add"
2222
headers = {}
2323
if self.api_key:
2424
headers["Authorization"] = f"Bearer {self.api_key}"

0 commit comments

Comments
 (0)