fixed docker

This commit is contained in:
2026-02-04 15:37:59 +00:00
parent 6d271ef65b
commit 025ce8f763
16 changed files with 135 additions and 93 deletions

View File

@@ -39,6 +39,7 @@ const bodySchema = z.object({
})
export async function POST(request: NextRequest) {
let ageFilters: SerperAgeFilter | undefined
try {
const requestId = request.headers.get("x-request-id") ?? undefined;
if (!(await isAuthenticatedNextjs())) {
@@ -51,7 +52,7 @@ export async function POST(request: NextRequest) {
const body = await request.json()
const { analysis, minAgeDays, maxAgeDays } = bodySchema.parse(body)
const ageFilters: SerperAgeFilter = {
ageFilters = {
minAgeDays,
maxAgeDays,
}
@@ -287,15 +288,15 @@ async function analyzeOpportunities(
const relevanceScore = Math.min(keywordScore + problemScore, 1)
// Determine intent
let intent: Opportunity['intent'] = 'looking-for'
let intent: Opportunity['intent'] = 'looking'
if (content.includes('frustrated') || content.includes('hate') || content.includes('sucks')) {
intent = 'frustrated'
} else if (content.includes('alternative') || content.includes('switching')) {
intent = 'alternative'
intent = 'comparing'
} else if (content.includes('vs') || content.includes('comparison') || content.includes('better')) {
intent = 'comparison'
intent = 'comparing'
} else if (content.includes('how to') || content.includes('fix') || content.includes('solution')) {
intent = 'problem-solving'
intent = 'learning'
}
// Find matching persona
@@ -305,16 +306,21 @@ async function analyzeOpportunities(
if (relevanceScore >= 0.3) {
opportunities.push({
id: result.url,
title: result.title,
url: result.url,
platform: result.source,
source: result.source,
snippet: result.snippet.slice(0, 300),
relevanceScore,
painPoints: matchedProblems.slice(0, 3),
suggestedApproach: generateApproach(intent, analysis.productName),
matchedKeywords: matchedKeywords.slice(0, 5),
matchedProblems: matchedProblems.slice(0, 3),
matchedPersona,
intent
intent,
emotionalIntensity: intent === 'frustrated' ? 'high' : matchedProblems.length > 0 ? 'medium' : 'low',
status: 'new',
suggestedApproach: generateApproach(intent, analysis.productName),
softPitch: false
})
}
}