Skip to content

[BUG] .yaml type description forbids fields starting with underscore _ #184

@bgaidioz

Description

@bgaidioz

Describe the Bug

I decided to name certain metadata fields with underscores in front (e.g. __url or __type) because I've seen the LLM confusing them with regular object members that can be queried/filtered, etc. After they got named with __ in front, they looked "internal" and weren't used for filtering or projection.

But when documenting that in .yml, I hit the error by Pydantic: "Fields must not use names with leading underscores;". Because we internally turn the .yml into Pydantic models.

To Reproduce

Declare a tool that returns an object which has a field starting with _.

Expected Behavior

It's working as if nothing.

Environment

Configuration

          properties:
            objid:
              type: string
              description: Object ID (for tool chaining/internal reference only).
            __object_type:
              type: string
              description: object type for the returned object (metadata).
              examples: ["Project", "Invoice"]
            __info:
              type: string
              description: Object metadata (string representation).
            __url:
              type: string
              format: uri
              description: Direct link to the object in Vertec.

Error Output

Paste the full error output here

Additional Context

I got around by naming members meta_url, meta_type. Which I imagine will also work.

That said, imagine a user is running an existing REST API from the tool, and that API returns a JSON with underscores like that, it would be silly that the person has to rename all these fields because we use pydantic models (it's an internal detail).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions