You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 45bb6c9
Browse filesBrowse the repository at this point in the historyBrowse files
Defer building the SDK's own eager pydantic models and adapters
Every SDK-defined model that used to be built at import - the auth and
OAuth handler models, mcpserver's Resource/ResourceTemplate/Prompt/Tool/
Settings/Context/FuncMetadata, the client's parameter models, transport
security, apps and elicitation results - now sets defer_build=True, and
the remaining module-level TypeAdapters (message_validator,
token_request_adapter) build on first use as well. Each model or validator
is built once, at its first construction or validation, instead of adding
its cost to the import of the module that defines it.
Models that derive from BaseModel directly opt into the lazy __signature__
with @deferred_model, so inspect.signature() on a never-used model keeps
reporting its fields (and mcpserver Settings, whose signature could not
resolve at all before, now does).
0 commit comments