mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
feat: Add media parameter and update provider configurations
- In `PollinationsImage.py`, added a new parameter `media` of type `MediaListType` to the class method. - Changed the default value of `aspect_ratio` in `PollinationsImage.py` from `"1:1"` to `None`. - Updated the call to `_generate_image` in `PollinationsImage.py` to include the new `media` parameter. - In `Local.py`, changed the `working` attribute from `True` to `has_requirements` and set `active_by_default` to `False`. - In `Ollama.py`, set `active_by_default` to `False`. - In `DeepSeekAPI.py`, set `active_by_default` to `has_dsk` and `needs_auth` to `True`. - Modified the logic in `DeepSeekAPI.py` to yield `conversation` if `message_id` is present in the chunk. - In `api.py`, added a new key `active_by_default` to the provider dictionary, determining its value based on `needs_auth`. - In `types.py`, added a new attribute `active_by_default` to the `BaseProvider` class, initializing it to `None`. - In `web_search.py`, added a type check for `prompt` to ensure it is a string before proceeding with the search logic.
This commit is contained in:
parent
f6a5648dcf
commit
849322b8de
7 changed files with 19 additions and 6 deletions
|
|
@ -93,6 +93,7 @@ class Api:
|
|||
"vision": getattr(provider, "default_vision_model", None) is not None,
|
||||
"nodriver": getattr(provider, "use_nodriver", False),
|
||||
"hf_space": getattr(provider, "hf_space", False),
|
||||
"active_by_default": not provider.needs_auth if provider.active_by_default is None else provider.active_by_default,
|
||||
"auth": provider.needs_auth,
|
||||
"login_url": getattr(provider, "login_url", None),
|
||||
} for provider in Provider.__providers__ if provider.working and safe_get_models(provider)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue