mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
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:
parent
a727866caa
commit
77afb46c50
2 changed files with 4 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue