XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

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

77afb46c
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +4 -3
Modified g4f/api/stubs.py +2 -1
@@ -37,7 +37,8 @@ class RequestConfig(BaseModel):
37 37 modalities: Optional[list[str]] = None
38 38 audio: Optional[dict] = None
39 39 response_format: Optional[dict] = None
40 download_media: bool = True
40 download_media: bool = False
41 raw: bool = False
41 42 extra_body: Optional[dict] = None
42 43
43 44 class ChatCompletionsConfig(RequestConfig):
Modified g4f/client/__init__.py +2 -2
@@ -695,11 +695,11 @@ class AsyncCompletions:
695 695 else:
696 696 chunks.append(chunk)
697 697 if not started:
698 async for chunk in fallback(chunks):
698 for chunk in fallback(chunks):
699 699 yield chunk
700 700 if stream:
701 701 return raw_response(response)
702 return anext(raw_response())
702 return anext(raw_response(response))
703 703 if stream:
704 704 return fallback(response)
705 705 return anext(fallback(response))