Skip to content

fix: support dict and list[dict] as predictor input types#2928

Merged
markphelps merged 2 commits intomainfrom
dict-list
Apr 10, 2026
Merged

fix: support dict and list[dict] as predictor input types#2928
markphelps merged 2 commits intomainfrom
dict-list

Conversation

@markphelps
Copy link
Copy Markdown
Contributor

dict, Dict[str, Any], list[dict], and List[Dict[str, Any]] were not supported as predictor input types, even though they worked as output types. This broke models using chat-style messages: list[dict] inputs.

The fix maps dict types to ANY (opaque JSON objects) in both the Go tree-sitter schema generator (ResolveFieldType) and the Python SDK runtime (FieldType.from_type), handling all variants: bare dict, parameterized Dict[K,V], list[dict], Optional[dict], and PEP 604 union syntax.

dict, Dict[str, Any], list[dict], and List[Dict[str, Any]] were not
supported as predictor input types, even though they worked as output
types. This broke models using chat-style messages: list[dict] inputs.

The fix maps dict types to ANY (opaque JSON objects) in both the Go
tree-sitter schema generator (ResolveFieldType) and the Python SDK
runtime (FieldType.from_type), handling all variants: bare dict,
parameterized Dict[K,V], list[dict], Optional[dict], and PEP 604
union syntax.
@markphelps markphelps requested a review from a team as a code owner April 10, 2026 15:23
@ask-bonk
Copy link
Copy Markdown

ask-bonk bot commented Apr 10, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR adds support for dict, Dict[str, Any], list[dict], and List[Dict[str, Any]] as predictor input types, treating them as opaque JSON objects (mapped to ANY). The implementation is solid across both the Go tree-sitter schema generator and Python SDK runtime, with thorough test coverage.

LGTM

github run

The OpenAPI schema serializes property keys in sorted order (items,
title, type, x-order), not insertion order. Fix the stdout assertions
to match the actual key ordering.
@ask-bonk
Copy link
Copy Markdown

ask-bonk bot commented Apr 10, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR adds support for dict, Dict[str, Any], list[dict], and List[Dict[str, Any]] as predictor input types, treating them as opaque JSON objects (mapped to ANY). The implementation is solid across both the Go tree-sitter schema generator and Python SDK runtime, with thorough test coverage.

LGTM

github run

@markphelps markphelps requested a review from michaeldwan April 10, 2026 15:48
Copy link
Copy Markdown
Member

@michaeldwan michaeldwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@markphelps markphelps added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 8c33713 Apr 10, 2026
42 checks passed
@markphelps markphelps deleted the dict-list branch April 10, 2026 18:17
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.

2 participants