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:
H Lohaus 2024-12-17 21:17:40 +01:00 committed by GitHub
parent 0332d0d820
commit bbb858249b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 254 additions and 199 deletions

View file

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