@@ -73,12 +73,14 @@ class SXNGPlugin(Plugin):
7373
7474 def __init__ (self , plg_cfg : "PluginCfg" ) -> None :
7575 super ().__init__ (plg_cfg )
76- print (f"[DEBUG] LangChain plugin initialized with active={ plg_cfg .active } " )
76+ print (
77+ f"[DEBUG] LangChain plugin initialized with active={ plg_cfg .active } " )
7778
7879 self .info = PluginInfo (
7980 id = self .id ,
8081 name = gettext ("LangChain LLM" ),
81- description = gettext ("Generate AI answers using LLM with rich formatting" ),
82+ description = gettext (
83+ "Generate AI answers using LLM with rich formatting" ),
8284 preference_section = "general" ,
8385 )
8486
@@ -105,7 +107,8 @@ def post_search(
105107 ) -> EngineResults :
106108 results = EngineResults ()
107109
108- print (f"[DEBUG] post_search called for query: { search .search_query .query } " )
110+ print (
111+ f"[DEBUG] post_search called for query: { search .search_query .query } " )
109112
110113 # Only process on first page
111114 if search .search_query .pageno > 1 :
@@ -195,7 +198,8 @@ def _get_search_context(self, query: str) -> list[dict]:
195198 timeout_limit = 5.0 , # 5 second timeout for context search
196199 )
197200
198- print (f"[DEBUG] Created SearchQuery with { len (engine_refs )} engines" )
201+ print (
202+ f"[DEBUG] Created SearchQuery with { len (engine_refs )} engines" )
199203
200204 # Execute the search
201205 context_search = Search (context_search_query )
@@ -276,7 +280,8 @@ def _generate_contextual_answer_html(
276280 print (f"[DEBUG] Generated contextual response: { answer [:100 ]} ..." )
277281
278282 # Create formatted HTML answer from markdown
279- formatted_answer = self ._format_html_answer (answer , has_context = True )
283+ formatted_answer = self ._format_html_answer (
284+ answer , has_context = True )
280285 return formatted_answer
281286
282287 except Exception as e :
@@ -313,7 +318,8 @@ def _generate_simple_answer_html(self, query: str) -> str:
313318 print (f"[DEBUG] Generated simple response: { answer [:100 ]} ..." )
314319
315320 # Create formatted HTML answer from markdown
316- formatted_answer = self ._format_html_answer (answer , has_context = False )
321+ formatted_answer = self ._format_html_answer (
322+ answer , has_context = False )
317323 return formatted_answer
318324
319325 except Exception as e :
@@ -352,7 +358,8 @@ def _format_search_context(self, search_context: list[dict]) -> str:
352358 content = result .get ("content" , "" )
353359 if content :
354360 # Truncate content to avoid token limits
355- content = content [:300 ] + "..." if len (content ) > 300 else content
361+ content = content [:300 ] + \
362+ "..." if len (content ) > 300 else content
356363 context_parts .append (f"Content: { content } " )
357364
358365 source = result .get ("engine" , "Unknown" )
0 commit comments