Implement RAG summarization and context pipeline
- Add ContextPipeline for async RAG lookups - Implement RAG result summarization via LLMProcessor - Add CLI flag for PDF ingestion - Strip markdown code blocks from LLM responses - Update TUI context display to use ListItems
This commit is contained in:
+11
-1
@@ -87,7 +87,17 @@ class LLMProcessor:
|
||||
response_format=response_format,
|
||||
extra_body={"enable_thinking": False},
|
||||
)
|
||||
return response.choices[0].message.content
|
||||
content = response.choices[0].message.content
|
||||
|
||||
# Strip markdown code blocks if present
|
||||
if content.startswith("```"):
|
||||
import re
|
||||
|
||||
content = re.sub(
|
||||
r"^```(?:json)?\n?|```$", "", content, flags=re.MULTILINE
|
||||
).strip()
|
||||
|
||||
return content
|
||||
except Exception as e:
|
||||
logger.error(f"LLM Error: {e}")
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user