langchain/libs/core/langchain_core
Ivan 5b9290a449
Fix UnionType type var replacement (#25566)
[langchain_core] Fix UnionType type var replacement

- Added types.UnionType to typing.Union mapping

Type replacement cause `TypeError: 'type' object is not subscriptable`
if any of union type comes as function `_py_38_safe_origin` return
`types.UnionType` instead of `typing.Union`

```python
>>> from types import UnionType
>>> from typing import Union, get_origin
>>> type_ = get_origin(str | None)
>>> type_
<class 'types.UnionType'>
>>> UnionType[(str, None)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'type' object is not subscriptable
>>> Union[(str, None)]
typing.Optional[str]
```

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 14:22:09 -04:00
..
_api core[patch]: Improve some error messages and add another test for checking RunnableWithMessageHistory (#25209) 2024-08-22 18:14:27 +00:00
beta core: Updated docstring for Context class (#19079) 2024-03-18 21:15:14 -07:00
callbacks Merge support for group manager (#25360) 2024-08-15 09:56:31 -07:00
document_loaders core[minor]: add langsmith document loader (#25493) 2024-08-20 10:22:14 -07:00
documents core: docstrings documents (#23506) 2024-07-16 10:43:54 -04:00
embeddings core[patch]: Update API reference for fake embeddings (#25313) 2024-08-12 19:40:05 +00:00
example_selectors core[patch]: Sort Config attributes (#25127) 2024-08-07 02:53:50 +00:00
graph_vectorstores core,community: add beta decorator to missed GraphVectorStore extensions (#25562) 2024-08-19 17:29:09 -07:00
indexing core[patch]: Fix aindex API (#25155) 2024-08-08 12:08:18 -04:00
language_models core, partners: implement standard tracing params for LLMs (#25410) 2024-08-16 13:18:09 -04:00
load core[patch]: Remove default BaseModel init docstring (#25009) 2024-08-06 01:04:04 +00:00
messages core[patch]: support oai dicts as messages (#25621) 2024-08-21 16:13:15 +00:00
output_parsers core[patch]: support oai dicts as messages (#25621) 2024-08-21 16:13:15 +00:00
outputs core: Move json parsing in base chat model / output parser to bg thread (#24031) 2024-07-09 12:26:36 -07:00
prompts core[patch]: Improve some error messages and add another test for checking RunnableWithMessageHistory (#25209) 2024-08-22 18:14:27 +00:00
pydantic_v1 multiple: get rid of pyproject extras (#22581) 2024-06-06 15:45:22 -07:00
runnables core[patch]: Improve some error messages and add another test for checking RunnableWithMessageHistory (#25209) 2024-08-22 18:14:27 +00:00
tools core[patch]: tool import fix (#25419) 2024-08-14 22:54:13 +00:00
tracers multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
utils Fix UnionType type var replacement (#25566) 2024-08-22 14:22:09 -04:00
vectorstores multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
__init__.py docs: udpated api reference (#25172) 2024-08-14 07:00:17 -07:00
agents.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
caches.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
chat_history.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
chat_loaders.py core: chat_* docstrings (#23412) 2024-06-27 17:29:38 -04:00
chat_sessions.py core: chat_* docstrings (#23412) 2024-06-27 17:29:38 -04:00
env.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
exceptions.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
globals.py core[patch]: Fix word spelling error in globals.py (#24532) 2024-07-23 14:27:16 +00:00
memory.py core[patch]: Sort Config attributes (#25127) 2024-08-07 02:53:50 +00:00
prompt_values.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
py.typed core[minor], langchain[patch], experimental[patch]: Added missing py.typed to langchain_core (#14143) 2023-12-01 19:15:23 -08:00
rate_limiters.py core[patch]: use time.monotonic() instead time.time() in InMemoryRateLimiter 2024-08-09 11:31:20 -04:00
retrievers.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
stores.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
structured_query.py core[patch]: docstrings langchain_core/ files update (#24285) 2024-07-16 09:21:51 -04:00
sys_info.py core[patch]: Include dependencies in sys_info (#25076) 2024-08-06 09:57:39 -04:00