refac: optimisation

This commit is contained in:
Timothy Jaeryang Baek
2024-11-21 21:04:35 -08:00
parent 4b83a83576
commit 9a2dd5b126
2 changed files with 7 additions and 2 deletions

View File

@@ -6,7 +6,10 @@ from pathlib import Path
from typing import Literal, Optional, overload
import aiohttp
from aiocache import cached
import requests
from open_webui.apps.webui.models.models import Models
from open_webui.config import (
CACHE_DIR,
@@ -325,6 +328,7 @@ async def get_all_models_responses() -> list:
return responses
@cached(ttl=3)
async def get_all_models() -> dict[str, list]:
log.info("get_all_models()")