diff --git a/app/services/insight.py b/app/services/insight.py index 7e25de3..06cca4c 100644 --- a/app/services/insight.py +++ b/app/services/insight.py @@ -87,11 +87,15 @@ class QueryProcessor: context_parts.append(f"Location: {investor_headquarters}") if investor_description: context_parts.append(f"Description: {investor_description}") - if investment_thesis: - thesis_str = ", ".join(investment_thesis[:3]) # Limit to first 3 + if investment_thesis and isinstance(investment_thesis, list): + thesis_str = ", ".join( + str(item) for item in investment_thesis[:3] + ) # Limit to first 3 context_parts.append(f"Investment Focus: {thesis_str}") - if portfolio_highlights: - portfolio_str = ", ".join(portfolio_highlights[:5]) # Limit to first 5 + if portfolio_highlights and isinstance(portfolio_highlights, list): + portfolio_str = ", ".join( + str(item) for item in portfolio_highlights[:5] + ) # Limit to first 5 context_parts.append(f"Notable Portfolio Companies: {portfolio_str}") context = "\n".join(context_parts)