Skip to content

schema_dsl() raises IndexError when a field has no name before the colon #1545

Description

@ikatyal2110

Calling schema_dsl() with a field that has no name before the colon crashes with IndexError: list index out of range.

Repro:

from llm.utils import schema_dsl
schema_dsl(':just a description')  # IndexError
schema_dsl('name, :description')   # IndexError

Root cause (llm/utils.py line 394-395): after field.split(":", 1), field_info can be an empty string. field_info.strip().split() then returns [], so field_parts[0] raises IndexError.

The fix is to continue when field_parts is empty, silently skipping the nameless field — consistent with how blank field strings are already filtered out during field splitting.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions