cherry-pick 9495778c
This commit is contained in:
parent
af49572886
commit
c9abde6979
1 changed files with 13 additions and 0 deletions
|
|
@ -27,6 +27,19 @@ from lightrag.utils import (
|
|||
safe_unicode_decode,
|
||||
logger,
|
||||
)
|
||||
|
||||
# Try to import Langfuse for LLM observability (optional)
|
||||
# Falls back to standard OpenAI client if not available
|
||||
try:
|
||||
from langfuse.openai import AsyncOpenAI
|
||||
|
||||
LANGFUSE_ENABLED = True
|
||||
logger.info("Langfuse observability enabled for OpenAI client")
|
||||
except ImportError:
|
||||
from openai import AsyncOpenAI
|
||||
|
||||
LANGFUSE_ENABLED = False
|
||||
logger.debug("Langfuse not available, using standard OpenAI client")
|
||||
from lightrag.types import GPTKeywordExtractionFormat
|
||||
from lightrag.api import __api_version__
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue