Files
letta-server/letta/llm_api/mistral.py
Kian Jones fecf6decfb chore: migrate to ruff (#4305)
* base requirements

* autofix

* Configure ruff for Python linting and formatting

- Set up minimal ruff configuration with basic checks (E, W, F, I)
- Add temporary ignores for common issues during migration
- Configure pre-commit hooks to use ruff with pass_filenames
- This enables gradual migration from black to ruff

* Delete sdj

* autofixed only

* migrate lint action

* more autofixed

* more fixes

* change precommit

* try changing the hook

* try this stuff
2025-08-29 11:11:19 -07:00

23 lines
662 B
Python

import aiohttp
from letta.log import get_logger
from letta.utils import smart_urljoin
logger = get_logger(__name__)
async def mistral_get_model_list_async(url: str, api_key: str) -> dict:
url = smart_urljoin(url, "models")
headers = {"Content-Type": "application/json"}
if api_key is not None:
headers["Authorization"] = f"Bearer {api_key}"
logger.debug("Sending request to %s", url)
async with aiohttp.ClientSession() as session:
# TODO add query param "tool" to be true
async with session.get(url, headers=headers) as response:
response.raise_for_status()
return await response.json()