mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Improve gradient in gui, show only models with enabled providers (#2492)
- **Cloudflare Provider**: Added error handling for missing requirements when fetching arguments. - **Copilot Provider**: Updated the prompt formatting to use a maximum length function, improving message handling. - **PollinationsAI Provider**: Adjusted the prompt length to a maximum of 5000 characters. - **GitHub Copilot Provider**: Updated to use `ClientSession` for better session management. - **CSS Updates**: Enhanced the gradient styling in the GUI for a more visually appealing interface. - **JavaScript Updates**: Added functionality to toggle search options in the chat interface.
This commit is contained in:
parent
0332d0d820
commit
bbb858249b
20 changed files with 254 additions and 199 deletions
|
|
@ -30,6 +30,7 @@ class Api:
|
|||
"providers": [
|
||||
getattr(provider, "parent", provider.__name__)
|
||||
for provider in providers
|
||||
if provider.working
|
||||
]
|
||||
}
|
||||
for model, providers in models.__models__.values()]
|
||||
|
|
@ -178,9 +179,9 @@ class Api:
|
|||
}
|
||||
|
||||
def handle_provider(self, provider_handler, model):
|
||||
if isinstance(provider_handler, IterListProvider):
|
||||
if isinstance(provider_handler, IterListProvider) and provider_handler.last_provider is not None:
|
||||
provider_handler = provider_handler.last_provider
|
||||
if issubclass(provider_handler, ProviderModelMixin) and provider_handler.last_model is not None:
|
||||
if hasattr(provider_handler, "last_model") and provider_handler.last_model is not None:
|
||||
model = provider_handler.last_model
|
||||
return self._format_json("provider", {**provider_handler.get_dict(), "model": model})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue