diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-11-19 10:59:49 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-11-19 10:59:49 +0100 |
commit | 08085d345b919f99deb0ea1b8338c868002b7334 (patch) | |
tree | 9e3c4c04dee6c3cc28efcd8144c947f3fd7529c8 /g4f/Provider/airforce/AirforceChat.py | |
parent | Ask for auth on image upload (diff) | |
download | gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar.gz gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar.bz2 gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar.lz gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar.xz gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.tar.zst gpt4free-08085d345b919f99deb0ea1b8338c868002b7334.zip |
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 |