Commit Graph
7 Commits
Author SHA1 Message Date
Long Chen 28e68c52d6 agents: Agent[Deps, State, Output] from deps_type, state_type and output_type
Agent took deps_type and state_type but nothing read them: the
framework loads state with the door's type, and a type checker could
not use them because Agent was not generic. run() took Any and returned
RunResult[Any], so a wrong state or deps object and a typo on a
structured output all passed the type checker.

Agent is now generic, the three parameters read from those arguments
and Any when one is left out, so a bare Agent annotation and a subclass
keep working. run(), stream(), @agent.instructions and
@agent.output_validator carry the types, and agent.run(state=ctx.state)
checks the door's state type against the agent's.

tests/type_checks/agent_generics.py pins this: each expected error has
a type: ignore[code], and scripts/check_types.py checks the package, so
it fails both when a check is lost and when a new error appears.
2026-10-14 14:44:21 +08:00
webdev bbf163fe1c fix(scripts): type-check for linux on every host OS, matching CI (#6623) 2026-08-02 18:06:10 -07:00
Arseny BoykovandClaude a4e8680692 ci: speedup type checking (#5982)
Co-authored-by: Claude <noreply@anthropic.com>
2026-06-10 06:29:42 +04:00
Chenghao Mou bdd77a6704 chore(mypy): enable mypy cache in type checking (#5192) 2026-03-23 12:27:55 +00:00
Théo Monnom 3b617ef0f1 fix uv lock file & drop python 3.9 support & upgrade dependencies (#4728) 2026-02-06 10:57:37 -08:00
David Zhao c5282ae318 type cleanup, include all plugins into type checker (#4491) 2026-01-11 23:25:20 -08:00
Chenghao Mou 0cc77447d6 Update STT tests and add batch recognition flag (#4425) 2026-01-06 17:14:23 +00:00