Skip to content

Bug in editing function #9

@HuijiaoLuo

Description

@HuijiaoLuo

Hello,

I tried to run the examples in colab. Due to the limited computational resources, I used a smaller LLM model (i.e. DoclingWritingAgent(model_id=model_ids.MISTRALAI_MISTRAL_0_3_7B, tools=[])) instead of the DoclingWritingAgent(model_id=model_ids.OPENAI_GPT_OSS_20B, tools=[]). The bug occured as below:

Traceback (most recent call last):
File "/content/docling-agent/examples/example_02_edit_report.py", line 63, in
main()
File "/content/docling-agent/examples/example_02_edit_report.py", line 60, in main
run_task(ipath=ipath, opath=[1], task=[0], model_id=model_id)
File "/content/docling-agent/examples/example_02_edit_report.py", line 27, in run_task
document = agent.run(
^^^^^^^^^^
File "/content/docling-agent/docling_agent/agent/editor.py", line 69, in run
op = self._identify_document_items(task=task, document=document)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/docling-agent/docling_agent/agent/editor.py", line 143, in _identify_document_items
raise ValueError(f"operation not in op: {ops[0]}")
ValueError: operation not in op: [{'operation': 'update_section_heading_level', 'to_level': {'#/texts/2': 2, '#/texts/4': 1, '#/texts/5': 2, '#/texts/7': 2, '#/texts/9': 2, '#/texts/11': 1, '#/texts/12': 3, '#/texts/14': 3, '#/texts/51': 1, '#/texts/52': 2, '#/texts/54': 2, '#/texts/56': 2, '#/texts/58': 1, '#/texts/59': 3, '#/texts/61': 3, '#/texts/85': 1, '#/texts/86': 2, '#/texts/88': 2, '#/texts/90': 1, '#/texts/91': 2, '#/texts/93': 2, '#/texts/123': 1}}]

The others are kept as the same as your setting. Could you please have a look and give some advice?
Best,
HJ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions