You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
system=`You extract data from JSON content. Return ONLY the extracted data as readable text. Do NOT output any thinking, reasoning, or explanation.`;
289
318
290
-
constuser=`/no_think
319
+
user=`/no_think
320
+
You are a data extraction assistant. The page content below is JSON data from a search API response. Parse the JSON and extract the specific information requested.
321
+
322
+
JSON CONTENT:
323
+
${contentForPrompt}
324
+
325
+
EXTRACTION REQUEST:
326
+
${extractQuery}
327
+
328
+
INSTRUCTIONS:
329
+
1. Parse the JSON structure carefully
330
+
2. Look for the requested fields in the JSON objects (e.g., in "docs", "results", "items", "response.docs", or similar arrays)
331
+
3. If the requested fields exist, extract and format them as readable text
332
+
4. If the request asks for first/top/last N items, return exactly N matching items when available and do not include extra rows
333
+
5. If the JSON does NOT contain the requested fields, list what fields ARE available and return "NOT_FOUND: available fields: <field list>"
334
+
6. Return ONLY the extracted text or the NOT_FOUND message
335
+
336
+
EXTRACTED TEXT:`;
337
+
}else{
338
+
system=`You extract specific text from page content. Return only the extracted text. Do NOT output any thinking, reasoning, or explanation.`;
339
+
340
+
user=`/no_think
291
341
You are a text extraction assistant. Given the page content below, extract the specific information requested.
292
342
293
343
PAGE CONTENT:
@@ -299,10 +349,12 @@ ${extractQuery}
299
349
INSTRUCTIONS:
300
350
1. Read the content carefully
301
351
2. Find and extract ONLY the specific information requested
302
-
3. Return ONLY the extracted text, nothing else
303
-
4. If the information is not found, return "NOT_FOUND"
352
+
3. If the request asks for first/top/last N items, return exactly N matching items when available and do not include extra rows
353
+
4. Return ONLY the extracted text, nothing else
354
+
5. If the information is not found, return "NOT_FOUND"
304
355
305
356
EXTRACTED TEXT:`;
357
+
}
306
358
307
359
return[system,user];
308
360
}
@@ -351,6 +403,8 @@ If the task asks to COUNT items (e.g., "how many listings", "number of results",
351
403
- Set "countTarget" to describe what to count (e.g., "listings", "products", "articles")
352
404
- The system will scroll through the entire page and sum up counts
353
405
- Do NOT use EXTRACT for counting tasks — EXTRACT only sees the current viewport
406
+
- Do NOT use SCROLL_AND_COUNT for "first N", "top N", "latest N", or "oldest N" requests.
407
+
Those ask for a list of records, not a total count. Use EXTRACT for those.
0 commit comments