Schemas for nested objects may use anyOf/allOf/oneOf/$ref instead of a
top-level 'type' key. Direct dict access prop_info['type'] and
prop_info['title'] would raise KeyError in those cases (e.g. Dropbox
SEARCH_FILE_OR_FOLDER with an 'options' parameter).
Changes:
- prop_info['type'] -> prop_info.get('type')
- prop_info['title'] -> prop_info.get('title', prop_name)
- FALLBACK_VALUES[prop_type] -> FALLBACK_VALUES.get(prop_type)
- When prop_type is None, delegate to json_schema_to_pydantic_type()
which already handles all combiner schemas correctly
Fixes#2459
The `_python_reserved` set was hardcoded to only `{"for", "async"}`,
missing `"from"` and all other Python keywords. Tools from toolkits like
Intercom that have a `from` parameter caused `ValueError: 'from' is not
a valid parameter name` when building function signatures.
Extracted keyword substitution logic into shared utilities
(`substitute_reserved_python_keywords` / `reinstate_reserved_python_keywords`)
using `keyword.iskeyword()` from stdlib for complete coverage, and applied
it to all affected providers: langchain, gemini, langgraph, autogen, llamaindex.
Closes PLEN-1671