Skip to content

feat: support Annotated[T, Field(...)] in function schema#2435

Open
haasonsaas wants to merge 1 commit intoopenai:mainfrom
haasonsaas:codex/2428-code
Open

feat: support Annotated[T, Field(...)] in function schema#2435
haasonsaas wants to merge 1 commit intoopenai:mainfrom
haasonsaas:codex/2428-code

Conversation

@haasonsaas
Copy link

@haasonsaas haasonsaas commented Feb 7, 2026

Derived from #2428, but split docs changes out per review feedback.

  • Adds support for Annotated[T, Field(...)] on @function_tool args.
  • Includes tests in tests/test_function_schema.py.

Docs follow-up: see the companion PR from haasonsaas:codex/2428-docs (kept separate so it can be merged/released independently).

…rameters

- Preserve per-parameter Annotated metadata and extract FieldInfo when building fields
- Add _extract_field_info_from_metadata() helper; use it in normal-parameter branch
- Merge annotated Field with docstring description and optional signature default
- Add tests for required/optional constraints, string constraints, and multiple params
@haasonsaas
Copy link
Author

CI is green (lint/typecheck/tests/docs). Looks ready to merge once a maintainer has a moment.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants