Skip to content

#173- fix hallucination bug#174

Open
Cubix33 wants to merge 1 commit intofireform-core:mainfrom
Cubix33:fix-repeated-hallucination
Open

#173- fix hallucination bug#174
Cubix33 wants to merge 1 commit intofireform-core:mainfrom
Cubix33:fix-repeated-hallucination

Conversation

@Cubix33
Copy link

@Cubix33 Cubix33 commented Mar 3, 2026

Closes #173

📝 Description

This PR resolves the issue where the PDF filler was "hallucinating" repeating values (e.g., repeating the name in every field).

🛠️ Key Changes

  • main.py: Restored the use of descriptive_fields when calling the controller. By passing human-readable labels instead of generic PDF widget IDs (like textbox_0_0), the LLM now has the necessary semantic context to extract accurate, distinct values from the transcript.
  • llm.py (Loop Fix): Removed the .keys() call in main_loop(). Since the target fields are passed as a list, calling .keys() was causing a runtime crash.

🧪 Quality Check

  • Verified that the LLM receives descriptive prompts (e.g., "Employee's name") instead of generic IDs.
  • Validated that the final PDF contains unique data for each field rather than repeating the same string.

📸 Evidence

Before Fix (Hallucination):

{
  "textbox_0_0": "John Doe",
  "textbox_0_1": "John Doe",
  "textbox_0_2": "managing director"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: PDF Filler Hallucinates Repeating Values

1 participant