Update RequestConfig to set download_media default to False and add raw parameter; modify AsyncCompletions to handle raw_response correctly

This commit is contained in:
hlohaus 2025-10-09 19:39:13 +02:00
parent a727866caa
commit 77afb46c50
2 changed files with 4 additions and 3 deletions

View file

@ -37,7 +37,8 @@ class RequestConfig(BaseModel):
modalities: Optional[list[str]] = None
audio: Optional[dict] = None
response_format: Optional[dict] = None
download_media: bool = True
download_media: bool = False
raw: bool = False
extra_body: Optional[dict] = None
class ChatCompletionsConfig(RequestConfig):

View file

@ -695,11 +695,11 @@ class AsyncCompletions:
else:
chunks.append(chunk)
if not started:
async for chunk in fallback(chunks):
for chunk in fallback(chunks):
yield chunk
if stream:
return raw_response(response)
return anext(raw_response())
return anext(raw_response(response))
if stream:
return fallback(response)
return anext(fallback(response))