mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 11:07:36 +00:00
Moves `_ORIGIN_MAP` dict from inside `_py_38_safe_origin()` to module level constant. This avoids dict allocation on every function call, reducing garbage collection pressure during frequent tool conversions. The function is called during typed dict to pydantic model conversion which happens during tool binding and invocation - a hot path in LangChain. **Testing:** `make lint` passes --------- Co-authored-by: Mason Daugherty <mason@langchain.dev> Co-authored-by: Mason Daugherty <github@mdrxy.com>