mirror of
https://github.com/tiennm99/cheahjs-free-llm-api-resources.git
synced 2026-10-16 10:15:00 +00:00
remove unused mistral client and pin dependencies
mistralai 2.x moved the Mistral class out of the top-level package, breaking the daily CI run. The client was instantiated but never used, so drop it along with the unused rate_limited_mistral_chat helper, and pin remaining deps to avoid future surprise upgrades.
This commit is contained in:
1 parent
c3ac91133b
commit
659ee72bd8
2 files changed
+4
-24
No files matched your search
@@ -7,7 +7,6 @@ import requests
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from google.cloud import cloudquotas_v1
|
||||
from mistralai import Mistral
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import time
|
||||
import re
|
||||
@@ -23,10 +22,6 @@ from data import (
|
||||
load_dotenv()
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# Global clients
|
||||
mistral_client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
|
||||
last_mistral_request_time = 0
|
||||
|
||||
|
||||
def create_logger(provider_name):
|
||||
logger = logging.getLogger(provider_name)
|
||||
@@ -485,20 +480,6 @@ def fetch_lambda_models(logger):
|
||||
return ret_models
|
||||
|
||||
|
||||
def rate_limited_mistral_chat(client, **kwargs):
|
||||
global last_mistral_request_time
|
||||
|
||||
# Ensure at least 1 second between requests
|
||||
current_time = time.time()
|
||||
time_since_last = current_time - last_mistral_request_time
|
||||
if time_since_last < 1:
|
||||
time.sleep(1 - time_since_last)
|
||||
|
||||
response = client.chat.complete(**kwargs)
|
||||
last_mistral_request_time = time.time()
|
||||
return response
|
||||
|
||||
|
||||
def fetch_samba_models(logger):
|
||||
logger.info("Fetching SambaNova models...")
|
||||
r = requests.get("https://cloud.sambanova.ai/api/pricing")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
requests
|
||||
python-dotenv
|
||||
google-cloud-quotas
|
||||
mistralai
|
||||
beautifulsoup4
|
||||
requests==2.33.1
|
||||
python-dotenv==1.2.2
|
||||
google-cloud-quotas==0.6.0
|
||||
beautifulsoup4==4.14.3
|
||||
Reference in new issue
Block a user