You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/core/langchain_core/language_models
Nuno Campos fdfb51ad8d
core: Two updates to chat model interface (#19684)
- .stream() and .astream() call on_llm_new_token, removing the need for
subclasses to do so. Backwards compatible because now we don't pass
run_manager into ._stream and ._astream
- .generate() and .agenerate() now handle `stream: bool` kwarg for
_generate and _agenerate. Subclasses handle this arg by delegating to
._stream(), now one less thing they need to do. Backwards compat because
this is an optional arg that we now never pass to the subclasses
- .generate() and .agenerate() now inspect callback handlers to decide
on a default value for stream:bool if not passed in. This auto enables
streaming when using astream_events and astream_log
- as a result of these three changes any usage of .astream_events and
.astream_log should now yield chat model stream events
- In future PRs we can update all subclasses to reflect these two things
now handled by base class, but in meantime all will continue to work
3 months ago
..
__init__.py core[minor]: moved fake llms and embeddings to core (#19226) 3 months ago
base.py core[minor]: Enhance cache flexibility in BaseChatModel (#17386) 3 months ago
chat_models.py core: Two updates to chat model interface (#19684) 3 months ago
fake.py core[minor]: moved fake llms and embeddings to core (#19226) 3 months ago
fake_chat_models.py core[patch]: Pass sync run manager for sync stream fallback in astream (#19280) 3 months ago
llms.py core: Simplify astream logic in BaseChatModel and BaseLLM (#19332) 3 months ago