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:
hlohaus 2025-07-01 03:10:21 +02:00
parent dcbeebd662
commit 78c0d67d54
4 changed files with 21 additions and 104 deletions

View file

@ -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