diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-11-19 11:04:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 11:04:01 +0100 |
commit | 23b3458216c86dbc8815e42379d32a8887ccd94c (patch) | |
tree | 1dd2ea30923cb356c1e57d1a3f7816cc93060c90 /g4f/Provider/airforce/AirforceChat.py | |
parent | Merge pull request #2372 from hlohaus/info (diff) | |
parent | Add image upload to Copilot provider (diff) | |
download | gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar.gz gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar.bz2 gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar.lz gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar.xz gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.tar.zst gpt4free-23b3458216c86dbc8815e42379d32a8887ccd94c.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 |