File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ ${content}
104104` ;
105105
106106 if ( dataToEnrich ) {
107- promptTemplate += `Format: JSON
107+ promptTemplate += `Original JSON object:
108108---
109109${ JSON . stringify ( dataToEnrich , null , 2 ) }
110110------
@@ -116,9 +116,9 @@ Your task is: ${extractionTask}
116116## Guidelines:
1171171. Extract ONLY information explicitly stated in the context
1181182. Enrich the original JSON object with information from the context
119- 3. Fill additional fields based on relevant information in the context
120- 4. Do not make assumptions or infer missing data
121- 5. Leave fields empty when information is not present or you are uncertain
119+ 3. Do not remove any fields from the original JSON object
120+ 4. Only update existing fields and fill in additional fields if new and relevant information is available in the context
121+ 5. Do not make assumptions or infer missing data
1221226. Do not include information that appears incomplete or truncated
123123
124124` ;
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ describe("extractors", () => {
306306 expect ( prompt ) . toContain ( "Context information is below:" ) ;
307307 expect ( prompt ) . toContain ( "Format: markdown" ) ;
308308 expect ( prompt ) . toContain ( "Some markdown content" ) ;
309- expect ( prompt ) . toContain ( "Format: JSON" ) ;
309+ expect ( prompt ) . toContain ( "Original JSON object " ) ;
310310 expect ( prompt ) . toContain ( JSON . stringify ( dataToEnrich , null , 2 ) ) ;
311311 expect ( prompt ) . toContain (
312312 "You are a data extraction assistant that extracts structured information from the above context in markdown and JSON"
@@ -315,7 +315,7 @@ describe("extractors", () => {
315315 "Enrich the original JSON object with information from the context"
316316 ) ;
317317 expect ( prompt ) . toContain (
318- "Fill additional fields based on relevant information in the context"
318+ "Only update existing fields and fill in additional fields if new and relevant information is available in the context"
319319 ) ;
320320 expect ( prompt ) . toContain (
321321 "Return only the structured data in valid JSON format"
You can’t perform that action at this time.
0 commit comments