Deploy on 2026-06-06 12:04:41

This commit is contained in:
Hamza-Ayed
2026-06-06 12:04:41 +03:00
parent f468227019
commit ed60fa3ce2
5 changed files with 110 additions and 35 deletions

View File

@@ -23,24 +23,41 @@ class AiAnalyzer
*/
public function analyze(string $title, string $description): array
{
$companyProfile = '';
$profilePath = __DIR__ . '/../../../COMPANY_PROFILE.md';
if (file_exists($profilePath)) {
$companyProfile = file_get_contents($profilePath);
}
if (!$this->apiKey) {
return $this->fallbackAnalysis($title, $description);
}
$prompt = <<<PROMPT
You are ScoutIQ, an investor intelligence AI. Analyze the following startup/investment content and return a JSON object with:
- "type": one of ["grant", "competition", "demo_day", "event", "partnership", "investment", "news", "other"]
- "opportunity_type": one of ["vc_funding", "accelerator", "incubator", "grant", "competition", "demo_day", "event", "partnership", "other"]
- "score": integer 0-100 (relevance to startups seeking funding)
- "tags": array of relevant tags (max 5)
- "is_opportunity": boolean (true if it's a funding/investment opportunity)
- "summary": 1-2 sentence summary in Arabic language of what this is, highlighting key strengths and contact/application info if present
- "organization_name": extracted organization name if any, or null
- "country": extracted country if any, or null
You are ScoutIQ, an investor intelligence AI. Analyze the following startup/investment content and evaluate its fit for our startup based on the provided company profile.
Company Profile:
{$companyProfile}
Content to Analyze:
Title: {$title}
Description: {$description}
Return a JSON object with EXACTLY these fields:
- "type": one of ["grant", "competition", "demo_day", "event", "partnership", "investment", "news", "other"]
- "opportunity_type": one of ["vc_funding", "accelerator", "incubator", "grant", "competition", "demo_day", "event", "partnership", "other"]
- "fit_score": integer 0-100 (Match score based on how well this opportunity fits the Company Profile: sector, stage, country, etc.)
- "tags": array of relevant tags (max 5)
- "is_opportunity": boolean (true if it's a funding/investment opportunity that is relevant to our profile)
- "summary": 1-2 sentence summary in Arabic of what this is
- "organization_name": extracted organization name if any, or null
- "country": extracted country if any, or null
- "why_it_matters": array of strings in Arabic (2-3 bullet points of why this is a good fit and why we should care)
- "requirements": array of strings in Arabic (2-3 bullet points of the most important requirements or eligibility criteria)
- "deadline": string (extracted deadline date, or null if not found)
- "effort": string (one of ["عالي", "متوسط", "منخفض"] depending on the effort required to apply)
- "potential_return": string (one of ["عالي", "متوسط", "منخفض"] depending on the value it brings)
Respond ONLY with valid JSON, no markdown, no code fences.
PROMPT;
@@ -264,12 +281,17 @@ PROMPT;
return [
'type' => $type,
'opportunity_type' => $opportunityType,
'score' => $score,
'fit_score' => $score,
'tags' => $tags,
'is_opportunity' => $isOpportunity,
'summary' => substr($description, 0, 200),
'organization_name' => $orgName,
'country' => $country,
'why_it_matters' => ['فرصة عامة'],
'requirements' => ['غير محدد'],
'deadline' => null,
'effort' => 'متوسط',
'potential_return' => 'متوسط',
];
}
}