Commit Graph

11138 Commits

Author SHA1 Message Date
William FH
fad6fc866a
Rm DeepInfra Breakpoint Comment (#25206)
tbh should rm the print staement too
2024-08-22 14:43:44 -04:00
yahya-mouman
e5bb4cb646
lagchain-pinecone: add id to similarity documents results (#25630)
- **Description:** This change adds the ID field that's required in
Pinecone to the result documents of the similarity search method.
- **Issue:** Lack of document metadata namely the ID field

- [x] **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.


- [x] **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, ccurme, vbarda, hwchase17.

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 18:33:26 +00:00
Eric Pinzur
01ded5e2f9
community: add metadata filter to CassandraGraphVectorStore (#25663)
- **Description:** 
- Added metadata filtering support to
`langchain_community.graph_vectorstores.cassandra.CassandraGraphVectorStore`
  - Also fixed type conversion issues highlighted by mypy.
- **Dependencies:** 
  - `ragstack-ai-knowledge-store 0.2.0` (released July 23, 2024)

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 14:27:16 -04:00
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
William FH
8230ba47f3
core[patch]: Improve some error messages and add another test for checking RunnableWithMessageHistory (#25209)
Also add more useful error messages.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-08-22 18:14:27 +00:00
Hasan Kumar
b4fcda7657
langchain: Fix type warnings when passing Runnable as agent to AgentExecutor (#24750)
Fix for https://github.com/langchain-ai/langchain/issues/13075

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 14:02:02 -04:00
sslee
61228da1c4
fix typo (#25673) 2024-08-22 17:33:53 +00:00
Leonid Ganeline
d886f4e107
docs: integrations reference update 9 (#25511)
Added missed provider pages. Added missed references and descriptions.
2024-08-22 10:25:41 -07:00
Maurits Bos
3da752c7bb
Update pyproject.toml of packageopenai-functions-agent-gmail to prevent ModuleOrPackageNotFound error (#25597)
I was trying to add this package using langchain-cli: `langchain app add
openai-functions-agent-gmail`, but when then try to build the whole
project using poetry or pip, it fails with the following
error:`poetry.core.masonry.utils.module.ModuleOrPackageNotFound: No
file/folder found for package openai-functions-agent-gmail`

This was fixed by modifying the pyproject.toml as in this commit

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, ccurme, vbarda, hwchase17.
2024-08-22 17:22:50 +00:00
Leonid Ganeline
624e0747b9
docs: integrations reference updates 10 (#25556)
Added missed provider pages. Added descriptions, links.
2024-08-22 10:21:54 -07:00
Erick Friis
9447925d94
cli: release 0.0.30 (#25672) 2024-08-22 10:21:19 -07:00
Leonid Ganeline
47adc7f32b
docs: integrations reference updates 11 (#25598)
Added missed provider pages and links.
2024-08-22 10:19:17 -07:00
Dylan
16fc0a866e
docs: Change Pull Request to Merge Request in GitLab notebook (#25649)
- **Description:** In GitLab we call these "merge requests" rather than
"pull requests" so I thought I'd go ahead and update the notebook.
- **Issue:** N/A
- **Dependencies:** none
- **Twitter handle:** N/A

Thanks for creating the tools and notebook to help people work with
GitLab. I thought I'd contribute some minor docs updates here.
2024-08-22 17:15:45 +00:00
mschoenb97IL
e499caa9cd
community: Give more context on DeepInfra 500 errors (#25671)
Description: DeepInfra 500 errors have useful information in the text
field that isn't being exposed to the user. I updated the error message
to fix this.

As an example, this code

```
from langchain_community.chat_models import ChatDeepInfra
from langchain_core.messages import HumanMessage

model = "meta-llama/Meta-Llama-3-70B-Instruct"
deepinfra_api_token = "..."

model = ChatDeepInfra(model=model, deepinfra_api_token=deepinfra_api_token)

messages = [HumanMessage("All work and no play makes Jack a dull boy\n" * 9000)]
response = model.invoke(messages)
```

Currently gives this error:
```
langchain_community.chat_models.deepinfra.ChatDeepInfraException: DeepInfra Server: Error 500
```

This change would give the following error:
```
langchain_community.chat_models.deepinfra.ChatDeepInfraException: DeepInfra Server error status 500: {"error":{"message":"Requested input length 99009 exceeds maximum input length 8192"}}
```
2024-08-22 10:10:51 -07:00
Brian Sam-Bodden
29c873dd69
[docs]: update Redis (langchain-redis) documentation notebooks (vectorstore, llm caching, chat message history) (#25113)
- **Description:** Adds notebooks for Redis Partner Package
(langchain-redis)
- **Issue:** N/A
- **Dependencies:** None
- **Twitter handle:** `@bsbodden` and `@redis`

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 11:53:02 -04:00
Rajendra Kadam
4ff2f4499e
community: Refactor PebbloRetrievalQA (#25583)
**Refactor PebbloRetrievalQA**
  - Created `APIWrapper` and moved API logic into it.
  - Created smaller functions/methods for better readability.
  - Properly read environment variables.
  - Removed unused code.
  - Updated models

**Issue:** NA
**Dependencies:** NA
**tests**:  NA
2024-08-22 11:51:21 -04:00
Rajendra Kadam
1f1679e960
community: Refactor PebbloSafeLoader (#25582)
**Refactor PebbloSafeLoader**
  - Created `APIWrapper` and moved API logic into it.
  - Moved helper functions to the utility file.
  - Created smaller functions and methods for better readability.
  - Properly read environment variables.
  - Removed unused code.

**Issue:** NA
**Dependencies:** NA
**tests**:  Updated
2024-08-22 11:46:52 -04:00
maang-h
5e3a321f71
docs: Add ChatZhipuAI tool calling and structured output docstring (#25669)
- **Description:** Add `ChatZhipuAI` tool calling and structured output
docstring.
2024-08-22 10:34:41 -04:00
Krishna Kulkarni
820da64983
limit the most recent documents to fetch from MongoDB database. (#25435)
limit the most recent documents to fetch from MongoDB database.

Thank you for contributing to LangChain!

- [ ] **limit the most recent documents to fetch from MongoDB
database.**: "langchain_mongodb: limit the most recent documents to
fetch from MongoDB database."


- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
- **Description:** Added a doc_limit parameter which enables the limit
for the documents to fetch from MongoDB database
    - **Issue:** 
    - **Dependencies:** None

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-08-22 10:33:45 -04:00
ccurme
67b6e6c2e3
docs[patch]: update AWS integration docs (#25631)
De-beta ChatBedrockConverse.
2024-08-22 09:22:03 -04:00
Swastik-Swarup-Dash
6247259438
update_readme (#25665)
Updated LangChain Expression Language (LCEL). for Easier Understanding
2024-08-22 13:18:32 +00:00
Noah Mayerhofer
0091947efd
community: add retry for session expired exception in neo4j (#25660)
Description: The neo4j driver can raise a SessionExpired error, which is
considered a retriable error. If a query fails with a SessionExpired
error, this change retries every query once. This change will make the
neo4j integration less flaky.
Twitter handle: noahmay_
2024-08-22 13:07:36 +00:00
Erick Friis
e958f76160
docs: migration guide nits (#25600) 2024-08-22 04:24:34 +00:00
Yuki Watanabe
3981d736df
databricks: Add partner package directory and ChatDatabricks implementation (#25430)
### Summary

Create `langchain-databricks` as a new partner packages. This PR does
not migrate all existing Databricks integration, but the package will
eventually contain:

* `ChatDatabricks` (implemented in this PR)
* `DatabricksVectorSearch`
* `DatabricksEmbeddings`
* ~`UCFunctionToolkit`~ (will be done after UC SDK work which
drastically simplify implementation)

Also, this PR does not add integration tests yet. This will be added
once the Databricks test workspace is ready.

Tagging @efriis as POC


### Tracker
[✍️] Create a package and imgrate ChatDatabricks
[ ] Migrate DatabricksVectorSearch, DatabricksEmbeddings, and their docs
~[ ] Migrate UCFunctionToolkit and its doc~
[ ] Add provider document and update README.md
[ ] Add integration tests and set up secrets (after moved to an external
package)
[ ] Add deprecation note to the community implementations.

---------

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-21 17:19:28 -07:00
Scott Hurrey
fb1d67edf6
box: add retrievers and fix docs (#25633)
Thank you for contributing to LangChain!


**Description:** Adding `BoxRetriever` for langchain_box. This retriever
handles two use cases:
* Retrieve all documents that match a full-text search
* Retrieve the answer to a Box AI prompt as a Document

**Twitter handle:** @BoxPlatform


- [x] **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.


- [x] **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, ccurme, vbarda, hwchase17.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-21 22:40:40 +00:00
Bagatur
4f347cbcb9
docs: link Versions in intro (#25640) 2024-08-21 21:02:25 +00:00
jakerachleff
4591bc0b01
Use 1.101 instead of 1.100 bc 1.100 was yanked (#25638) 2024-08-21 21:02:01 +00:00
Bagatur
f535e8a99e
docs: ls similar examples header (#25642) 2024-08-21 20:50:24 +00:00
Erick Friis
766b650fdc
chroma: add back fastapi optional dep (#25641) 2024-08-21 20:00:47 +00:00
Bagatur
9daff60698
docs: fix openai api ref (#25639) 2024-08-21 12:55:17 -07:00
Erick Friis
c8be0a9f70
partners/unstructured: release 0.1.2 (#25637) 2024-08-21 12:53:55 -07:00
Bagatur
f4b3c90886
docs: add prereq commas (#25626) 2024-08-21 12:38:53 -07:00
Christophe Bornet
b71ae52e65
[unstructured][security] Bump unstructured version (#25364)
This ensures version 0.15.7+ is pulled. 
This version of unstructured uses a version of NLTK >= 3.8.2 that has a
fix for a critical CVE:
https://github.com/advisories/GHSA-cgvx-9447-vcch
2024-08-21 12:25:24 -07:00
Bagatur
39c44817ae
infra: test convert_message (#25632) 2024-08-21 18:24:06 +00:00
Bagatur
4feda41ab6
docs: ls how to link (#25624) 2024-08-21 10:18:08 -07:00
Bagatur
71c2ec6782
docs: langsmith few shot prereq (#25623) 2024-08-21 16:44:25 +00:00
Bagatur
628574b9c2
core[patch]: Release 0.2.34 (#25622) 2024-08-21 16:26:51 +00:00
Bagatur
0bc3845e1e
core[patch]: support oai dicts as messages (#25621)
and update langsmtih example selector docs
2024-08-21 16:13:15 +00:00
Bagatur
a78843bb77
docs: how to use langsmith few shot (#25601)
Requires langsmith 0.1.101 release
2024-08-21 08:12:42 -07:00
ccurme
10a2ce2a26
together[patch]: use mixtral in standard integration tests (#25619)
Mistral 7B occasionally fails tool-calling tests. Updating to Mixtral
appears to improve this.
2024-08-21 14:26:25 +00:00
Mikhail Khludnev
d457d7d121
docs: Update qdrant.ipynb "BM25".lower() (#25616)
Otherwise I've got KeyError from `fastembeds`
2024-08-21 09:45:00 -04:00
Dristy Srivastava
b002702af6
[Community][minor]: Updating metadata with full_path in SharePoint loader (#25593)
- **Description:** Updating metadata for sharepoint loader with full
path i.e., webUrl
- **Issue:** NA
- **Dependencies:** NA
- **Tests:** NA
- **Docs** NA

Co-authored-by: dristy.cd <dristy@clouddefense.io>
Co-authored-by: ccurme <chester.curme@gmail.com>
2024-08-21 13:10:14 +00:00
ZhangShenao
34d0417eb5
Improvement[Doc] Improve api doc in of PineconeVectorStore (#25605)
Complete missing arguments in api doc of `PineconeVectorStore`.
2024-08-21 08:58:00 -04:00
wangda
e7d6b25653
docs:Correcting spelling mistakes (#25612) 2024-08-21 08:49:12 -04:00
Scott Hurrey
55fd2e2158
box: add langchain box package and DocumentLoader (#25506)
Thank you for contributing to LangChain!

-Description: Adding new package: `langchain-box`:

* `langchain_box.document_loaders.BoxLoader` — DocumentLoader
functionality
* `langchain_box.utilities.BoxAPIWrapper` — Box-specific code
* `langchain_box.utilities.BoxAuth` — Helper class for Box
authentication
* `langchain_box.utilities.BoxAuthType` — enum used by BoxAuth class

- Twitter handle: @boxplatform


- [x] **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.


- [x] **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, ccurme, vbarda, hwchase17.

---------

Co-authored-by: Erick Friis <erickfriis@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-21 02:23:43 +00:00
Bagatur
be27e1787f
docs: few-shot conceptual guide (#25596)
Co-authored-by: ccurme <chester.curme@gmail.com>
Co-authored-by: jakerachleff <jake@langchain.dev>
2024-08-21 00:39:50 +00:00
Erick Friis
f878df404f
partners/chroma: release 0.1.3 (#25599) 2024-08-20 23:24:32 +00:00
Erick Friis
60cf49a618
chroma: ban chromadb sdk versions 0.5.4 and 0.5.5 due to pydantic bug (#25586)
also remove some unused dependencies (fastapi) and unused test/lint/dev
dependencies (community, openai, textsplitters)

chromadb 0.5.4 introduced usage of `model_fields` which is pydantic v2
specific. also released in 0.5.5
2024-08-20 23:21:38 +00:00
Erick Friis
e37caa9b9a
core: fix fallback context overwriting (#25550)
fixes #25337
2024-08-20 16:07:12 -07:00
Bagatur
3e296e39c8
docs: update examples in api ref (#25589) 2024-08-20 11:08:24 -07:00