2025-04-02 09:01:55 +02:00

28 lines
675 B
Python

"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
import httpx
import logging
import os
from typing import Any, Protocol
class Logger(Protocol):
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
pass
class NoOpLogger:
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
pass
def get_body_content(req: httpx.Request) -> str:
return "<streaming body>" if not hasattr(req, "_content") else str(req.content)
def get_default_logger() -> Logger:
if os.getenv("MISTRAL_DEBUG"):
logging.basicConfig(level=logging.DEBUG)
return logging.getLogger("mistralai")
return NoOpLogger()