Commit Graph

8590 Commits

Author SHA1 Message Date
Usama Ahmed
5e5802d1cb docs: fixing typo in argument name (#20028)
it's "mode" instead of "model", I fixed it
2024-04-25 17:39:36 -07:00
Bagatur
9b74781a61 docs: hide experimental anthropic (#20030) 2024-04-25 17:39:36 -07:00
Lance Martin
b852119dfb Update example cookbook for Anthropic tool use (#20029) 2024-04-25 17:39:36 -07:00
Leonid Ganeline
92c99b28d5 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>
2024-04-25 17:39:36 -07:00
Bagatur
4c916e6a38 docs: mark anthropic tools wrapper as deprecated (#20024) 2024-04-25 17:39:36 -07:00
Leonid Ganeline
3bc76e826a 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>
2024-04-25 17:39:35 -07:00
Bagatur
9aa5091d5b anthropic[patch]: Release 0.1.6 (#20026) 2024-04-25 17:39:35 -07:00
Bagatur
490e15dfb0 anthropic[patch]: use anthropic 0.23 (#20022) 2024-04-25 17:39:35 -07:00
Leonid Ganeline
b90492f742 docs integrations/providers update 10 (#19970)
Fixed broken links. Formatted to get consistent forms. Added missed
imports in the example code
2024-04-25 17:39:35 -07:00
Leonid Ganeline
fd5348c512 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
2024-04-25 17:39:35 -07:00
Bagatur
31d314bb36 anthropic[patch]: fix experimental tests (#20021) 2024-04-25 17:39:35 -07:00
Lance Martin
558766ff16 Add cookbook for Anthropic .with_structured_output() (#20017) 2024-04-25 17:39:35 -07:00
Bagatur
88bd15492c anthropic[patch]: bump core dep (#20019)
]
2024-04-25 17:39:35 -07:00
Bagatur
c4ea7f1cf9 anthropic[minor]: tool use (#20016) 2024-04-25 17:39:35 -07:00
Leonid Ganeline
4021636f7f community[minor]: added missed class to __all__ (#19888)
Added missed `UnstructuredCHMLoader` class to the
document_loader.\_\_init\_\_.py \_\_all\_\_
2024-04-25 17:39:35 -07:00
Jacob Lee
8ca41dbfec 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
2024-04-25 17:39:35 -07:00
Chris Papademetrious
2b2b724b44 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>
2024-04-25 17:39:35 -07:00
Tomaz Bratanic
b12dbc2f50 community[minor]: Add metadata filtering support for neo4j vector (#20001) 2024-04-25 17:39:35 -07:00
Ben Mitchell
7435c91210 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>
2024-04-25 17:39:35 -07:00
Christophe Bornet
ef56db3cbd [docs][minor]: Fix typo in Custom Document Loader doc (#20003) 2024-04-25 17:39:35 -07:00
Jan Nissen
05ec02e10d 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.
2024-04-25 17:39:35 -07:00
Christophe Bornet
e6129268c1 core[minor]: Add aformat to FewShotPromptTemplate (#19652) 2024-04-25 17:39:35 -07:00
Utkarsha Gupte
d7bab1660f 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
2024-04-25 17:39:35 -07:00
harry-cohere
1dcf692396 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)
2024-04-25 17:39:35 -07:00
Jacob Lee
9f3c265951 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>
2024-04-25 17:39:35 -07:00
Erick Friis
d7544e5345 groq: handle streaming tool call case (#19978) 2024-04-25 17:39:35 -07:00
Erick Friis
15becafc41 groq: fix core version (#19976) 2024-04-25 17:39:35 -07:00
Erick Friis
12e59bca96 groq: release 0.1.0 (#19975) 2024-04-25 17:39:35 -07:00
Graden Rea
1ad45ddb14 groq: Add tool calling support (#19971)
**Description:** Add with_structured_output to groq chat models
**Issue:** 
**Dependencies:** N/A
**Twitter handle:** N/A
2024-04-25 17:39:35 -07:00
Eugene Yurtsev
151dd5cc26 cli[minor]: Add disable sockets in unit tests (#19877) 2024-04-25 17:39:35 -07:00
Eugene Yurtsev
3bffbb4bba docs: Custom Document Loaders (#19935)
Add information that shows how to create custom document loaders
2024-04-25 17:39:35 -07:00
Erick Friis
891e19de14 core: fix try_load_from_hub for older langchain versions load_chain (#19964) 2024-04-25 17:39:35 -07:00
Tomaz Bratanic
b91c8b337d 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..
2024-04-25 17:39:35 -07:00
happy-go-lucky
fa4addd8e1 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
2024-04-25 17:39:35 -07:00
Cheng, Penghui
94b825a1fc 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>
2024-04-25 17:39:35 -07:00
Eugene Yurtsev
959898bc53 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
2024-04-25 17:39:35 -07:00
Eugene Yurtsev
35102f34cd core[minor]: Add aload to document loader (#19936)
Add aload to document loader
2024-04-25 17:39:35 -07:00
Ángel Igareta
deec556808 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>
2024-04-25 17:39:35 -07:00
Bagatur
c587511150 core[patch]: Release 0.1.39 (#19940) 2024-04-25 17:39:35 -07:00
Nuno Campos
71a6929d27 core: BaseChatModel modify chat message before passing to run_manager (#19939)
Thank you for contributing to LangChain!

- [ ] **PR title**: "package: description"
- Where "package" is whichever of langchain, community, core,
experimental, etc. is being modified. Use "docs: ..." for purely docs
changes, "templates: ..." for template changes, "infra: ..." for CI
changes.
  - Example: "community: add foobar LLM"


- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
    - **Description:** a description of the change
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!


- [ ] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.


- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
2024-04-25 17:39:35 -07:00
aditya thomas
dacf95573a docs: update cohere documentation (#19700)
**Description:** Update of Cohere documentation (main provider page)
**Issue:** After addition of the Cohere partner package, the
documentation was out of date
**Dependencies:** None

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-04-25 17:39:35 -07:00
Leonid Kuligin
9553e5c345 deprecating integrations moved to langchain_google_community (#19841)
Thank you for contributing to LangChain!

- [ ] **PR title**: "community: deprecating integrations moved to
langchain_google_community"

- [ ] **PR message**: deprecating integrations moved to
langchain_google_community

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
2024-04-25 17:39:35 -07:00
Erick Friis
e676c2f220 core[patch]: remove requests (#19891)
Removes required usage of `requests` from `langchain-core`, all of which
has been deprecated.

- removes Tracer V1 implementations
- removes old `try_load_from_hub` github-based hub implementations

Removal done in a way where imports will still succeed, and usage will
fail with a `RuntimeError`.
2024-04-25 17:39:35 -07:00
Erick Friis
0967167c79 pinecone[patch]: source tag (#19739) 2024-04-25 17:39:35 -07:00
Wang Guan
2f45c23d9c docs: mention caveats with CacheBackedEmbeddings.embed_query (#19926)
Thank you for contributing to LangChain!

- [x] **PR title**: "package: description"
- Where "package" is whichever of langchain, community, core,
experimental, etc. is being modified. Use "docs: ..." for purely docs
changes, "templates: ..." for template changes, "infra: ..." for CI
changes.
  - Example: "community: add foobar LLM"


- [x] **PR message**:
- **Description:** mention not-caching methods in CacheBackedEmbeddings
  - **Issue:** n/a I almost created one until I read the code 
  - **Dependencies:** n/a
  - **Twitter handle:** `tarsylia`


- [ ] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.


- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
2024-04-25 17:39:35 -07:00
harry-cohere
26c88caa40 cohere: Improve integration test stability, fix documents bug (#19929)
**Description**: Improves the stability of all Cohere partner package
integration tests. Fixes a bug with document parsing (both dicts and
Documents are handled).
2024-04-25 17:39:35 -07:00
harry-cohere
bac2a6a7c2 cohere: simplify integration test (#19928)
**Description**: This PR simplifies an integration test within the
Cohere partner package:
 * It no longer relies on exact model answers
 * It no longer relies on a third party tool
2024-04-25 17:39:34 -07:00
billytrend-cohere
baa0c8d674 cohere, docs: update imports and installs to langchain_cohere (#19918)
cohere: update imports and installs to langchain_cohere

---------

Co-authored-by: Harry M <127103098+harry-cohere@users.noreply.github.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-04-25 17:39:34 -07:00
Erick Friis
7b0e293c15 cohere[patch]: release 0.1.0rc2 (#19924) 2024-04-25 17:39:34 -07:00
harry-cohere
1af698881e cohere[patch]: Add multihop tool agent (#19919)
**Description**: Adds an agent that uses Cohere with multiple hops and
multiple tools.

This PR is a continuation of
https://github.com/langchain-ai/langchain/pull/19650 - which was
previously approved. Conceptually nothing has changed, but this PR has
extra fixes, documentation and testing.

---------

Co-authored-by: BeatrixCohere <128378696+BeatrixCohere@users.noreply.github.com>
Co-authored-by: Erick Friis <erickfriis@gmail.com>
2024-04-25 17:39:34 -07:00