summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/airforce/AirforceChat.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-11-19 11:04:01 +0100
committerGitHub <noreply@github.com>2024-11-19 11:04:01 +0100
commit23b3458216c86dbc8815e42379d32a8887ccd94c (patch)
tree1dd2ea30923cb356c1e57d1a3f7816cc93060c90 /g4f/Provider/airforce/AirforceChat.py
parentMerge pull request #2372 from hlohaus/info (diff)
parentAdd image upload to Copilot provider (diff)
downloadgpt4free-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.py11
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