File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 1010if not pm .is_installed ("openai" ):
1111 pm .install ("openai" )
1212
13- # Try to import Langfuse for LLM observability (optional)
14- # Falls back to standard OpenAI client if not available
15- try :
16- from langfuse .openai import AsyncOpenAI
17- LANGFUSE_ENABLED = True
18- logger .info ("Langfuse observability enabled for OpenAI client" )
19- except ImportError :
20- from openai import AsyncOpenAI
21- LANGFUSE_ENABLED = False
22- logger .debug ("Langfuse not available, using standard OpenAI client" )
23-
2413from openai import (
2514 APIConnectionError ,
2615 RateLimitError ,
3726 safe_unicode_decode ,
3827 logger ,
3928)
29+
30+ # Try to import Langfuse for LLM observability (optional)
31+ # Falls back to standard OpenAI client if not available
32+ try :
33+ from langfuse .openai import AsyncOpenAI
34+
35+ LANGFUSE_ENABLED = True
36+ logger .info ("Langfuse observability enabled for OpenAI client" )
37+ except ImportError :
38+ from openai import AsyncOpenAI
39+
40+ LANGFUSE_ENABLED = False
41+ logger .debug ("Langfuse not available, using standard OpenAI client" )
4042from lightrag .types import GPTKeywordExtractionFormat
4143from lightrag .api import __api_version__
4244
You can’t perform that action at this time.
0 commit comments