Commit Graph

8742 Commits (7997f3b7f8f9577af9f733828211c8a7dc095932)
 

Author SHA1 Message Date
Jacob Lee 58a2123ca0
docs[patch]: Add missing redirects (#20076) 5 months ago
Eugene Yurtsev 520ff50adc
community[patch]: Improve import callbacks to make it IDE friendly (#20050)
* declares __all__ as a list of strings (instead of dynamically
computing it)
* import type definitions when TYPE_CHECKING is true
5 months ago
Guangdong Liu 5a76087965
langchain-core[minor]: Allow passing local cache to language models (#19331)
After this PR it will be possible to pass a cache instance directly to a
language model. This is useful to allow different language models to use
different caches if needed.

- **Issue:** close #19276

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
5 months ago
Eugene Yurtsev e4fc0e7502
core[patch]: Document BaseCache abstraction in code (#20046)
Document the base cache abstraction in the cache.
5 months ago
Christophe Bornet 4d8a6a27a3
core[minor]: Implement aformat_prompt and ainvoke in BasePromptTemplate (#20035) 5 months ago
Christophe Bornet 7e5c1905b1
core[minor]: Add async aformat_document method (#20037) 5 months ago
Christophe Bornet 927793d088
Merge pull request #20038
* Implement aformat_messages for ChatMessagePromptTemplate
5 months ago
Erick Friis ebd24bb5d6
docs: fix title cap (#20048) 5 months ago
Eugene Yurtsev 1ee8cf7b20
Docs: Update custom chat model (#19967)
* Clean up in the existing tutorial
* Add model_name to identifying params
* Add table to summarize messages
5 months ago
Erick Friis 5fc7bb01e9
docs: weaviate docs (#20042) 5 months ago
Bagatur 38fb1429fe
docs: fix together model tab (#20032) 5 months ago
Jacob Lee b69af26717
docs[patch]: Fix Model I/O quickstart (#20031)
@baskaryan
5 months ago
Usama Ahmed 94ac42c573
docs: fixing typo in argument name (#20028)
it's "mode" instead of "model", I fixed it
5 months ago
Bagatur 07eeeb84f3
docs: hide experimental anthropic (#20030) 5 months ago
Lance Martin e76b9210dd
Update example cookbook for Anthropic tool use (#20029) 5 months ago
Leonid Ganeline 3856dedff4
docs: `integrations/providers` update 9 (#19941)
- Added missed providers
- Added links, descriptions in related examples
- Formatted in a consistent format

Co-authored-by: Erick Friis <erick@langchain.dev>
5 months ago
Bagatur 644ff46100
docs: mark anthropic tools wrapper as deprecated (#20024) 5 months ago
Leonid Ganeline 69bf6262aa
docs: `integrations/providers/unstructured` update (#19892)
Updated a page with existing document loaders with links to examples.
Fixed formatting of one example.

Co-authored-by: Erick Friis <erick@langchain.dev>
5 months ago
Bagatur 1b7ed6071a
anthropic[patch]: Release 0.1.6 (#20026) 5 months ago
Bagatur 6860450e48
anthropic[patch]: use anthropic 0.23 (#20022) 5 months ago
Leonid Ganeline 4c969286fe
docs `integrations/providers` update 10 (#19970)
Fixed broken links. Formatted to get consistent forms. Added missed
imports in the example code
5 months ago
Leonid Ganeline 82f0198be2
docs: `graphs` update (#19675)
Issue: The `graph` code was moved into the `community` package a long
ago. But the related documentation is still in the
[use_cases](https://python.langchain.com/docs/use_cases/graph/integrations/diffbot_graphtransformer)
section and not in the `integrations`.
Changes:
- moved the `use_cases/graph/integrations` notebooks into the
`integrations/graphs`
- renamed files and changed titles to follow the consistent format
- redirected old page URLs to new URLs in `vercel.json` and in several
other pages
- added descriptions and links when necessary
- formatted into the consistent format
5 months ago
Bagatur be3dd62de4
anthropic[patch]: fix experimental tests (#20021) 5 months ago
Lance Martin a6926772f0
Add cookbook for Anthropic .with_structured_output() (#20017) 5 months ago
Bagatur 86fdb79454
anthropic[patch]: bump core dep (#20019)
]
5 months ago
Bagatur 209de0a561
anthropic[minor]: tool use (#20016) 5 months ago
Leonid Ganeline 3aacd11846
community[minor]: added missed class to __all__ (#19888)
Added missed `UnstructuredCHMLoader` class to the
document_loader.\_\_init\_\_.py \_\_all\_\_
5 months ago
Jacob Lee 7f0cb3bfba
docs[patch]: Make Docusaurus and Vercel add trailing slashes when navigating by default (#20014)
Should hopefully avoid weird broken link edge cases.

Relative links now trip up the Docusaurus broken link checker, so this
PR also removes them.

Also snuck in a small addition about asyncio
5 months ago
Chris Papademetrious a954dedb77
langchain[minor]: enhance `LocalFileStore` to allow directory/file permissions to be specified (#18857)
**Description:**
The `LocalFileStore` class can be used to create an on-disk
`CacheBackedEmbeddings` cache. However, the default `umask` settings
gives file/directory write permissions only to the original user. Once
the cache directory is created by the first user, other users cannot
write their own cache entries into the directory.

To make the cache usable by multiple users, this pull request updates
the `LocalFileStore` constructor to allow the permissions for newly
created directories and files to be specified. The specified permissions
override the default `umask` values.

For example, when configured as follows:

```python
file_store = LocalFileStore(temp_dir, chmod_dir=0o770, chmod_file=0o660)
```

then "user" and "group" (but not "other") have permissions to access the
store, which means:

* Anyone in our group could contribute embeddings to the cache.
* If we implement cache cleanup/eviction in the future, anyone in our
group could perform the cleanup.

The default values for the `chmod_dir` and `chmod_file` parameters is
`None`, which retains the original behavior of using the default `umask`
settings.

**Issue:**
Implements enhancement #18075.

**Testing:**
I updated the `LocalFileStore` unit tests to test the permissions.

---------

Signed-off-by: chrispy <chrispy@synopsys.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
5 months ago
Tomaz Bratanic df25829f33
community[minor]: Add metadata filtering support for neo4j vector (#20001) 5 months ago
Ben Mitchell b52b78478f
community[minor]: Implement Async OpenSearch `afrom_texts` & `afrom_embeddings` (#20009)
- **Description:** Adds async variants of afrom_texts and
afrom_embeddings into `OpenSearchVectorSearch`, which allows for
`afrom_documents` to be called.
- **Issue:** I implemented this because my use case involves an async
scraper generating documents as and when they're ready to be ingested by
Embedding/OpenSearch
- **Dependencies:** None that I'm aware

Co-authored-by: Ben Mitchell <b.mitchell@reply.com>
5 months ago
Christophe Bornet 02152d3909
[docs][minor]: Fix typo in Custom Document Loader doc (#20003) 5 months ago
Jan Nissen 31e3ecc728
core[minor]: support pydantic V2 for JSONOutputParser, allow for other sources of JSON schemas (#19716)
This PR supports using Pydantic v2 objects to generate the schema for
the JSONOutputParser (#19441). This also adds a `json_schema` parameter
to allow users to pass any JSON schema to validate with, not just
pydantic.
5 months ago
Christophe Bornet f97de4e275
core[minor]: Add aformat to FewShotPromptTemplate (#19652) 5 months ago
Utkarsha Gupte b27f81c51c
core[patch]: mypy ignore fixes #17048 (#19931)
core/langchain_core/_api[Patch]: mypy ignore fixes #17048
Related to #17048

Applied mypy fixes to below two files:
libs/core/langchain_core/_api/deprecation.py
libs/core/langchain_core/_api/beta_decorator.py

Summary of Fixes:
**Issue 1**
class _deprecated_property(type(obj)): # type: ignore
error: Unsupported dynamic base class "type"  [misc]
Fix: 
1. Added an __init__ method to _deprecated_property to initialize the
fget, fset, fdel, and __doc__ attributes.
2. In the __get__, __set__, and __delete__ methods, we now use the
self.fget, self.fset, and self.fdel attributes to call the original
methods after emitting the warning.

3. The finalize function now creates an instance of _deprecated_property
with the fget, fset, fdel, and doc attributes from the original obj
property.



**Issue 2**



 def finalize(  # type: ignore
                wrapper: Callable[..., Any], new_doc: str
            ) -> T:


error: All conditional function variants must have identical
signatures



Fix:
Ensured that both definitions of the finalize function have the
same signature

Twitter Handle -
https://x.com/gupteutkarsha?s=11&t=uwHe4C3PPpGRvoO5Qpm1aA
5 months ago
harry-cohere e103492eb8
cohere: Add citations to agent, flexibility to tool parsing, fix SDK issue (#19965)
**Description:** Citations are the main addition in this PR. We now emit
them from the multihop agent! Additionally the agent is now more
flexible with observations (`Any` is now accepted), and the Cohere SDK
version is bumped to fix an issue with the most recent version of
pydantic v1 (1.10.15)
5 months ago
Jacob Lee 605c3f23e1
docs: reorg and visual refresh (#19765)
- put use cases in main sidebar
- move modules to own sidebar, rename components
- cleanup lcel section
- cleanup guides
- update font, cell highlighting

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
5 months ago
Erick Friis 51bdfe04e9
groq: handle streaming tool call case (#19978) 5 months ago
Erick Friis 5acb564d6f
groq: fix core version (#19976) 5 months ago
Erick Friis 9e60159043
groq: release 0.1.0 (#19975) 5 months ago
Graden Rea 88cf8a2905
groq: Add tool calling support (#19971)
**Description:** Add with_structured_output to groq chat models
**Issue:** 
**Dependencies:** N/A
**Twitter handle:** N/A
5 months ago
Eugene Yurtsev 6f20f140ca
cli[minor]: Add disable sockets in unit tests (#19877) 5 months ago
Eugene Yurtsev ea276d6547
docs: Custom Document Loaders (#19935)
Add information that shows how to create custom document loaders
5 months ago
Erick Friis 83f62fdacf
core: fix try_load_from_hub for older langchain versions load_chain (#19964) 5 months ago
Tomaz Bratanic 09a0ecd000
langchain[minor]: Tests update metadata filtering examples of documents (#19963)
Removing metadata properties that are dicts as some databases don't
support that, and those properties aren't used in tests anyhow..
5 months ago
happy-go-lucky c6432abdbe
community[patch]: Implement delete method and all async methods in opensearch_vector_search (#17321)
- **Description:** In order to use index and aindex in
libs/langchain/langchain/indexes/_api.py, I implemented delete method
and all async methods in opensearch_vector_search
- **Dependencies:** No changes
5 months ago
Cheng, Penghui cc407e8a1b
community[minor]: weight only quantization with intel-extension-for-transformers. (#14504)
Support weight only quantization with intel-extension-for-transformers.
[Intel® Extension for
Transformers](https://github.com/intel/intel-extension-for-transformers)
is an innovative toolkit to accelerate Transformer-based models on Intel
platforms, in particular effective on 4th Intel Xeon Scalable processor
[Sapphire
Rapids](https://www.intel.com/content/www/us/en/products/docs/processors/xeon-accelerated/4th-gen-xeon-scalable-processors.html)
(codenamed Sapphire Rapids). The toolkit provides the below key
features:

* Seamless user experience of model compressions on Transformer-based
models by extending [Hugging Face
transformers](https://github.com/huggingface/transformers) APIs and
leveraging [Intel® Neural
Compressor](https://github.com/intel/neural-compressor)
* Advanced software optimizations and unique compression-aware runtime.
* Optimized Transformer-based model packages.
*
[NeuralChat](https://github.com/intel/intel-extension-for-transformers/blob/main/intel_extension_for_transformers/neural_chat),
a customizable chatbot framework to create your own chatbot within
minutes by leveraging a rich set of plugins and SOTA optimizations.
*
[Inference](https://github.com/intel/intel-extension-for-transformers/blob/main/intel_extension_for_transformers/llm/runtime/graph)
of Large Language Model (LLM) in pure C/C++ with weight-only
quantization kernels.
This PR is an integration of weight only quantization feature with
intel-extension-for-transformers.

Unit test is in
lib/langchain/tests/integration_tests/llm/test_weight_only_quantization.py
The notebook is in
docs/docs/integrations/llms/weight_only_quantization.ipynb.
The document is in
docs/docs/integrations/providers/weight_only_quantization.mdx.

---------

Signed-off-by: Cheng, Penghui <penghui.cheng@intel.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
5 months ago
Eugene Yurtsev d6d843ec24
langchain-postgres: Initial package with postgres chat history implementation (#19884)
- [x] Add in code examples for the chat message history class
- [ ] ~Add docs with notebook examples~ (can this be done later?)
- [x] Update README.md
5 months ago
Eugene Yurtsev d293431e10
core[minor]: Add aload to document loader (#19936)
Add aload to document loader
5 months ago
Ángel Igareta 31a641a155
core: fix return of draw_mermaid_png and change to not save image by default (#19950)
- **Description:** Improvement for #19599: fixing missing return of
graph.draw_mermaid_png and improve it to make the saving of the rendered
image optional

Co-authored-by: Angel Igareta <angel.igareta@klarna.com>
5 months ago