mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-20 00:22:31 +00:00
style: move loguru import to module top level
Addresses reviewer suggestion to keep imports conventional.
This commit is contained in:
parent
1ced8d4420
commit
0fe7148e6e
@ -15,6 +15,7 @@ from collections.abc import Awaitable, Callable
|
|||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
import json_repair
|
import json_repair
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
if os.environ.get("LANGFUSE_SECRET_KEY") and importlib.util.find_spec("langfuse"):
|
if os.environ.get("LANGFUSE_SECRET_KEY") and importlib.util.find_spec("langfuse"):
|
||||||
from langfuse.openai import AsyncOpenAI
|
from langfuse.openai import AsyncOpenAI
|
||||||
@ -448,8 +449,6 @@ class OpenAICompatProvider(LLMProvider):
|
|||||||
self._responses_failures[key] = count
|
self._responses_failures[key] = count
|
||||||
if count >= _RESPONSES_FAILURE_THRESHOLD:
|
if count >= _RESPONSES_FAILURE_THRESHOLD:
|
||||||
self._responses_tripped_at[key] = time.monotonic()
|
self._responses_tripped_at[key] = time.monotonic()
|
||||||
from loguru import logger
|
|
||||||
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Responses API circuit open for {} — falling back to Chat Completions",
|
"Responses API circuit open for {} — falling back to Chat Completions",
|
||||||
key,
|
key,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user