Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
17815e9
1
Parent(s): b3ebb38
fix: resolve typescript build errors in internal portal navigation
Browse files- agents/kb_node.py +4 -1
agents/kb_node.py
CHANGED
|
@@ -175,6 +175,8 @@ async def _process_kb_search(state: AgentState, db: Any, skip_ai: bool = False)
|
|
| 175 |
best_article.title,
|
| 176 |
best_article.content
|
| 177 |
)
|
|
|
|
|
|
|
| 178 |
else:
|
| 179 |
logger.info(f"KB Search: Skipping AI Gap Analysis for article {best_article.id} (Express Mode)")
|
| 180 |
|
|
@@ -221,12 +223,13 @@ async def _perform_high_fidelity_gap_analysis(t_title: str, t_desc: str, a_title
|
|
| 221 |
chain = prompt | llm | JsonOutputParser()
|
| 222 |
|
| 223 |
try:
|
| 224 |
-
|
| 225 |
"ticket_title": t_title,
|
| 226 |
"ticket_description": t_desc,
|
| 227 |
"article_title": a_title,
|
| 228 |
"article_content": a_content
|
| 229 |
})
|
|
|
|
| 230 |
except Exception as e:
|
| 231 |
logger.error(f"Gap Analysis Failed: {str(e)}")
|
| 232 |
return {}
|
|
|
|
| 175 |
best_article.title,
|
| 176 |
best_article.content
|
| 177 |
)
|
| 178 |
+
if not isinstance(gap_data, dict):
|
| 179 |
+
gap_data = {}
|
| 180 |
else:
|
| 181 |
logger.info(f"KB Search: Skipping AI Gap Analysis for article {best_article.id} (Express Mode)")
|
| 182 |
|
|
|
|
| 223 |
chain = prompt | llm | JsonOutputParser()
|
| 224 |
|
| 225 |
try:
|
| 226 |
+
res = await chain.ainvoke({
|
| 227 |
"ticket_title": t_title,
|
| 228 |
"ticket_description": t_desc,
|
| 229 |
"article_title": a_title,
|
| 230 |
"article_content": a_content
|
| 231 |
})
|
| 232 |
+
return res if isinstance(res, dict) else {}
|
| 233 |
except Exception as e:
|
| 234 |
logger.error(f"Gap Analysis Failed: {str(e)}")
|
| 235 |
return {}
|