mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-05 18:20:35 -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
|
modalities: Optional[list[str]] = None
|
||||||
audio: Optional[dict] = None
|
audio: Optional[dict] = None
|
||||||
response_format: Optional[dict] = None
|
response_format: Optional[dict] = None
|
||||||
download_media: bool = True
|
download_media: bool = False
|
||||||
|
raw: bool = False
|
||||||
extra_body: Optional[dict] = None
|
extra_body: Optional[dict] = None
|
||||||
|
|
||||||
class ChatCompletionsConfig(RequestConfig):
|
class ChatCompletionsConfig(RequestConfig):
|
||||||
|
|
|
||||||
|
|
@ -695,11 +695,11 @@ class AsyncCompletions:
|
||||||
else:
|
else:
|
||||||
chunks.append(chunk)
|
chunks.append(chunk)
|
||||||
if not started:
|
if not started:
|
||||||
async for chunk in fallback(chunks):
|
for chunk in fallback(chunks):
|
||||||
yield chunk
|
yield chunk
|
||||||
if stream:
|
if stream:
|
||||||
return raw_response(response)
|
return raw_response(response)
|
||||||
return anext(raw_response())
|
return anext(raw_response(response))
|
||||||
if stream:
|
if stream:
|
||||||
return fallback(response)
|
return fallback(response)
|
||||||
return anext(fallback(response))
|
return anext(fallback(response))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue