Spaces:
Sleeping
Sleeping
const model = genAI.getGenerativeModel({ model: 'models/gemini-1.5-flash', systemInstruction: 'You are an OSINT analyst. Respond concisely and factually.', });
Browse files
app.js
CHANGED
|
@@ -31,29 +31,29 @@ app.post('/analyze', async (req, res) => {
|
|
| 31 |
const userContent = req.body.input_text;
|
| 32 |
const language = req.body.language;
|
| 33 |
|
| 34 |
-
|
| 35 |
-
You are an expert OSINT
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
Your
|
| 40 |
|
| 41 |
-
|
| 42 |
-
- Extract key
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
|
| 46 |
-
|
| 47 |
-
- Group
|
| 48 |
-
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
- Provide geopolitical framing
|
| 52 |
-
-
|
| 53 |
|
| 54 |
-
|
| 55 |
-
- Always return JSON objects in the following format:
|
| 56 |
|
|
|
|
| 57 |
{
|
| 58 |
"summary": "...",
|
| 59 |
"top_topics": ["...", "..."],
|
|
@@ -84,12 +84,17 @@ Structure the report:
|
|
| 84 |
"to": "2025-05-19T14:00Z"
|
| 85 |
}
|
| 86 |
}
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
`;
|
| 90 |
|
|
|
|
| 91 |
try {
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
| 93 |
const contents = [
|
| 94 |
{ role: 'user', parts: [{ text: systemPrompt }] },
|
| 95 |
{ role: 'user', parts: [{ text: userContent }] },
|
|
|
|
| 31 |
const userContent = req.body.input_text;
|
| 32 |
const language = req.body.language;
|
| 33 |
|
| 34 |
+
const systemPrompt = `
|
| 35 |
+
You are an expert OSINT analyst with 20 years of experience in real-time analysis of content from platforms such as Twitter/X, Telegram, and Reddit. Your task is to convert chaotic, multilingual, and fragmented social data into structured and actionable intelligence for journalism, NGO reporting, or risk monitoring.
|
| 36 |
|
| 37 |
+
Always operate within the principles of journalistic ethics, digital safety, and compliance with legal standards (e.g., GDPR, UN Human Rights). Your outputs must be evidence-based, unbiased, and free from speculation.
|
| 38 |
|
| 39 |
+
Your responsibilities include:
|
| 40 |
|
| 41 |
+
1. Content summarization:
|
| 42 |
+
- Extract key facts, sentiments, and narrative threads.
|
| 43 |
+
- Identify recurring keywords, hashtags, or propaganda themes.
|
| 44 |
+
- Include timestamps for relevant developments.
|
| 45 |
|
| 46 |
+
2. Influence classification:
|
| 47 |
+
- Group actors by tone (e.g., hostile, neutral, supportive).
|
| 48 |
+
- Detect and categorize bots, influencers, journalists, and unknown accounts.
|
| 49 |
|
| 50 |
+
3. Contextualization:
|
| 51 |
+
- Provide geopolitical or situational framing when relevant (e.g., protests, conflicts).
|
| 52 |
+
- Identify hate speech, disinformation, or manipulated content.
|
| 53 |
|
| 54 |
+
4. Format your response as a valid JSON object, using the following schema:
|
|
|
|
| 55 |
|
| 56 |
+
\`\`\`json
|
| 57 |
{
|
| 58 |
"summary": "...",
|
| 59 |
"top_topics": ["...", "..."],
|
|
|
|
| 84 |
"to": "2025-05-19T14:00Z"
|
| 85 |
}
|
| 86 |
}
|
| 87 |
+
\`\`\`
|
| 88 |
|
| 89 |
+
Now analyze the following content in the \${language} language:
|
| 90 |
`;
|
| 91 |
|
| 92 |
+
|
| 93 |
try {
|
| 94 |
+
const model = genAI.getGenerativeModel({
|
| 95 |
+
model: 'models/gemini-1.5-flash',
|
| 96 |
+
});
|
| 97 |
+
|
| 98 |
const contents = [
|
| 99 |
{ role: 'user', parts: [{ text: systemPrompt }] },
|
| 100 |
{ role: 'user', parts: [{ text: userContent }] },
|