mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
refactor: streamline auth handling and CLI structure
- Added `fallback_model = "deepseek"` to `PollinationsAI` class in `PollinationsAI.py` - Modified `PollinationsAI._agenerate` to safely call `get_model` only if `model` is not None - Removed unused login loop in `OpenaiChat.synthesize` method in `OpenaiChat.py` - Replaced full CLI parser and main function implementation in `__main__.py` with import from `.main` - Added `get_auth_result` method to `AsyncAuthedProvider` in `base_provider.py` for reusable auth retrieval - Replaced repeated auth loading logic in `create_completion` and `create_streaming_completion` with call to `get_auth_result` in `base_provider.py
This commit is contained in:
parent
dcbeebd662
commit
78c0d67d54
4 changed files with 21 additions and 104 deletions
|
|
@ -603,8 +603,6 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
|
|||
|
||||
@classmethod
|
||||
async def synthesize(cls, params: dict) -> AsyncIterator[bytes]:
|
||||
async for _ in cls.login():
|
||||
pass
|
||||
async with StreamSession(
|
||||
impersonate="chrome",
|
||||
timeout=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue