Skip to content

Commit d41a7fd

Browse files
fix: truncate long string content to 500 chars with ellipsis
1 parent 828bb08 commit d41a7fd

File tree

1 file changed

+2
-0
lines changed
  • backend/app/agents/devrel/nodes/handlers

1 file changed

+2
-0
lines changed

backend/app/agents/devrel/nodes/handlers/faq.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ async def _synthesize_faq_response(
167167
for i, result in enumerate(search_results[:5]): # Limit to top 5 results
168168
title = result.get('title', 'N/A')
169169
content = result.get('content', 'N/A')
170+
if isinstance(content, str) and len(content) > 500:
171+
content = content[:500] + "..."
170172
url = result.get('url', 'N/A')
171173
results_context += f"\nResult {i+1}:\nTitle: {title}\nContent: {content}\nURL: {url}\n"
172174

0 commit comments

Comments
 (0)