Skip to content

Commit 98f9892

Browse files
committed
remove unsupported fields from response
1 parent 59ed52d commit 98f9892

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/together/types/audio_speech.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from __future__ import annotations
22

3+
import base64
34
from enum import Enum
4-
from typing import Iterator, Union, BinaryIO, Optional, List
5-
import threading
5+
from typing import BinaryIO, Iterator, List, Optional, Union
66

77
from pydantic import BaseModel, ConfigDict
88

99
from together.together_response import TogetherResponse
10-
import base64
1110

1211

1312
class AudioResponseFormat(str, Enum):
@@ -79,23 +78,19 @@ class AudioSpeechStreamEventResponse(BaseModel):
7978

8079

8180
class AudioSpeechStreamResponse(BaseModel):
82-
8381
response: TogetherResponse | Iterator[TogetherResponse]
8482

8583
model_config = ConfigDict(arbitrary_types_allowed=True)
8684

8785
def stream_to_file(self, file_path: str) -> None:
88-
8986
if isinstance(self.response, TogetherResponse):
9087
# save response to file
9188
with open(file_path, "wb") as f:
9289
f.write(self.response.data)
9390

9491
elif isinstance(self.response, Iterator):
95-
9692
with open(file_path, "wb") as f:
9793
for chunk in self.response:
98-
9994
# Try to parse as stream chunk
10095
stream_event_response = AudioSpeechStreamEventResponse(
10196
response={"data": chunk.data}
@@ -154,15 +149,9 @@ class AudioTranslationRequest(BaseModel):
154149

155150
class AudioTranscriptionSegment(BaseModel):
156151
id: int
157-
seek: Optional[int] = None
158152
start: float
159153
end: float
160154
text: str
161-
tokens: Optional[List[int]] = None
162-
temperature: Optional[float] = None
163-
avg_logprob: Optional[float] = None
164-
compression_ratio: Optional[float] = None
165-
no_speech_prob: Optional[float] = None
166155

167156

168157
class AudioTranscriptionWord(BaseModel):

0 commit comments

Comments
 (0)