Skip to main content

Function Calling

8 requirements · 35 scenarios

Formatted Text Tag Parsing

JR-function-calling-001
The system SHALL parse HTML-like formatting tags in inserted text content to create appropriately formatted runs.
5 test scenarios
  • Bold tags parsed correctly JR-function-calling-001.1
  • Italic tags parsed correctly JR-function-calling-001.2
  • Underline tags parsed correctly JR-function-calling-001.3
  • Nested tags supported JR-function-calling-001.4
  • Malformed tags handled gracefully JR-function-calling-001.5

Pre-Insertion Duplicate Number Detection

JR-function-calling-007
The system SHALL detect and strip redundant section numbers from new content before insertion when the anchor paragraph uses automatic list numbering.
2 test scenarios
  • Redundant section number stripped before insertion JR-function-calling-007.1
  • Non-matching content preserved unchanged JR-function-calling-007.2

Post-Insertion Duplicate Number Correction

JR-function-calling-008
The system SHALL detect and correct duplicate numbering after paragraph insertion as a safety net.
2 test scenarios
  • Duplicate numbering fixed after insertion JR-function-calling-008.1
  • No duplicate detected leaves paragraph unchanged JR-function-calling-008.2

Ambiguous Match LLM Decision

JR-function-calling-011
When match count exceeds expected_replacements, the system SHALL consult an LLM to decide whether to proceed with all replacements or request a more specific anchor.
3 test scenarios
  • LLM approves bulk replacement JR-function-calling-011.1
  • LLM requests narrower anchor JR-function-calling-011.2
  • LLM decision call fails JR-function-calling-011.3

Edit Surgeon Agent

JR-function-calling-015
The Edit Surgeon Agent SHALL analyze the formatting and capitalization patterns of text being replaced and apply corresponding transformations to the replacement text.
5 test scenarios
  • ALL CAPS capitalization preservation JR-function-calling-015.1
  • Bold formatting replication JR-function-calling-015.2
  • Italic formatting replication JR-function-calling-015.3
  • Mixed formatting span JR-function-calling-015.4
  • No formatting needed (fast-path) JR-function-calling-015.5

Strict Match Validation as Default

JR-function-calling-018
The smart_edit_word_document tool SHALL enforce strict match count validation by default, failing when match count exceeds expected_replacements.

Note: A strict_mode parameter already exists but defaults to False. This change makes strict validation the default behavior.
4 test scenarios
  • Match count exceeds expected (default behavior) JR-function-calling-018.1
  • Match count equals expected JR-function-calling-018.2
  • Match count less than expected JR-function-calling-018.3
  • No matches found JR-function-calling-018.4

Match Count Validation Order

JR-function-calling-020
Match count validation SHALL occur BEFORE any replacement is executed.
2 test scenarios
  • Edit Surgeon path validation timing JR-function-calling-020.1
  • Standard path validation timing JR-function-calling-020.2

Smart Paragraph Insertion Tool

JR-function-calling-022
The system SHALL provide a smart_insert_paragraph tool that inserts new paragraphs into Word documents at structurally appropriate locations with correct formatting inheritance.
12 test scenarios
  • Insert paragraph after existing paragraph JR-function-calling-022.1
  • Insert paragraph before existing paragraph JR-function-calling-022.2
  • Preserve list numbering continuity JR-function-calling-022.3
  • Disambiguate TOC entries from content paragraphs JR-function-calling-022.4
  • Report ambiguous matches with TOC context JR-function-calling-022.5
  • Validate formatting anchor list level matches content pattern JR-function-calling-022.6
  • Validate subsection content uses subsection-level anchor JR-function-calling-022.7
  • Normalize space separator to tab JR-function-calling-022.8
  • Normalize tab separator to multiple spaces JR-function-calling-022.9
  • Preserve separator when already matching JR-function-calling-022.10
  • Handle non-list content JR-function-calling-022.11
  • Support all list pattern types JR-function-calling-022.12