diff options
Diffstat (limited to 'g4f/Provider/airforce/AirforceChat.py')
-rw-r--r-- | g4f/Provider/airforce/AirforceChat.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/g4f/Provider/airforce/AirforceChat.py b/g4f/Provider/airforce/AirforceChat.py index e94dd0a8..1efe0026 100644 --- a/g4f/Provider/airforce/AirforceChat.py +++ b/g4f/Provider/airforce/AirforceChat.py @@ -4,6 +4,7 @@ import json import requests from aiohttp import ClientSession from typing import List +import logging from ...typing import AsyncResult, Messages from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin @@ -54,9 +55,13 @@ class AirforceChat(AsyncGeneratorProvider, ProviderModelMixin): @classmethod def get_models(cls) -> list: if not cls.models: - response = requests.get('https://api.airforce/models') - data = response.json() - cls.models = [model['id'] for model in data['data']] + try: + response = requests.get('https://api.airforce/models', verify=False) + data = response.json() + cls.models = [model['id'] for model in data['data']] + except Exception as e: + logging.exception(e) + cls.models = [cls.default_model] model_aliases = { # openchat |