@@ -283,12 +283,15 @@ Batch Processing
283283 ]
284284
285285 result = controller.process(
286- entries=references,
287- output_format="bibtex"
286+ input_content="\n\n".join(references),
287+ input_type="txt",
288+ template_name="journal_article_full",
289+ output_format="bibtex",
290+ interactive_callback=lambda candidates: 0
288291 )
289292
290- print(f"Processed: {result['processed_count ']}")
291- print(f"Failed: {result['failed_count'] }")
293+ print(f"Processed: {result['report']['succeeded ']}")
294+ print(f"Failed: {len( result['report']['failed_entries']) }")
292295
293296Performance Optimization
294297------------------------
@@ -298,7 +301,13 @@ Performance Optimization
298301::
299302
300303 # Fast path for single reference
301- result = process_references("10.1038/nature14539")
304+ result = process_references(
305+ input_content="10.1038/nature14539",
306+ input_type="txt",
307+ template_name="journal_article_full",
308+ output_format="bibtex",
309+ interactive_callback=lambda c: 0
310+ )
302311
303312**Batch References: **
304313
@@ -329,7 +338,13 @@ Validation Errors
329338 from onecite import ValidationError
330339
331340 try:
332- result = process_references("")
341+ result = process_references(
342+ input_content="",
343+ input_type="txt",
344+ template_name="journal_article_full",
345+ output_format="bibtex",
346+ interactive_callback=lambda c: 0
347+ )
333348 except ValidationError:
334349 print("Empty input")
335350
@@ -341,7 +356,13 @@ Resolution Errors
341356 from onecite import ResolverError
342357
343358 try:
344- result = process_references("invalid/doi")
359+ result = process_references(
360+ input_content="invalid/doi",
361+ input_type="txt",
362+ template_name="journal_article_full",
363+ output_format="bibtex",
364+ interactive_callback=lambda c: 0
365+ )
345366 except ResolverError:
346367 print("Could not find reference")
347368 print("Check identifier or try again later")
@@ -353,14 +374,20 @@ Partial Success
353374
354375 from onecite import process_references
355376
356- result = process_references(mixed_refs)
377+ result = process_references(
378+ input_content=mixed_refs,
379+ input_type="txt",
380+ template_name="journal_article_full",
381+ output_format="bibtex",
382+ interactive_callback=lambda c: 0
383+ )
357384
358- print(f"Success: {result['processed_count ']}")
359- print(f"Failed: {result['failed_count'] }")
385+ print(f"Success: {result['report']['succeeded ']}")
386+ print(f"Failed: {len( result['report']['failed_entries']) }")
360387
361- if result['warnings ']:
362- for warning in result['warnings ']:
363- print(f"Warning : {warning }")
388+ if result['report']['failed_entries ']:
389+ for entry in result['report']['failed_entries ']:
390+ print(f"Failed entry {entry['id']} : {entry.get('error', 'Unknown') }")
364391
365392Pipeline Configuration
366393======================
0 commit comments