Commit Graph

8786 Commits (80679ab906b8b1c68abbea48edbc0cf09d232a06)
 

Author SHA1 Message Date
Erick Friis 37a9e23c05
community: switch to falkordb python client (#20229) 3 months ago
Christophe Bornet f43b48aebc
core[minor]: Implement aformat_messages for _StringImageMessagePromptTemplate (#20036) 3 months ago
Christophe Bornet 19001e6cb9
core[minor]: Implement aformat for FewShotPromptWithTemplates (#20039) 3 months ago
Erick Friis 855ba46f80
standard-tests: a standard unit and integration test set (#20182)
just chat models for now
3 months ago
Erick Friis 9b5cae045c
together: release 0.1.0 (#20225)
Resolved #20217
3 months ago
Eugene Yurtsev 7cfb643a1c
langchain-postgres: Remove remaining README.md file (#20221)
Repository has moved to langchain-ai/langchain-postgres
3 months ago
Eugene Yurtsev 2fa7266ebb
Remove postgres package (#20207)
Package moved
3 months ago
Simon Kelly a682f0d12b
openai[patch]: wrap stream code in context manager blocks (#18013)
**Description:**
Use the `Stream` context managers in `ChatOpenAi` `stream` and `astream`
method.

Using the context manager returned by the OpenAI client makes it
possible to terminate the stream early since the response connection
will be closed when the context manager exists.

**Issue:** #5340
**Twitter handle:** @snopoke

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
3 months ago
Shotaro Sano 6c11c8dac6
docs: Add documentation of `ElasticsearchStore.BM25RetrievalStrategy` (#20098)
This pull request follows up on
https://github.com/langchain-ai/langchain/pull/19314 and
https://github.com/langchain-ai/langchain-elastic/pull/6, adding
documentation for the `ElasticsearchStore.BM25RetrievalStrategy`.

Like other retrieval strategies, we are now introducing
BM25RetrievalStrategy.

### Background
- The `BM25RetrievalStrategy` has been introduced to `langchain-elastic`
via the pull request
https://github.com/langchain-ai/langchain-elastic/pull/6.
- This PR was initially created in the main `langchain` repository but
was moved to `langchain-elastic` during the review process due to the
migration of the partner package.
- The original PR can be found at
https://github.com/langchain-ai/langchain/pull/19314.
- As
[commented](https://github.com/langchain-ai/langchain/pull/19314#issuecomment-2023202401)
by @joemcelroy, documenting the new retrieval strategy is part of the
requirements for its introduction.

Although the `BM25RetrievalStrategy` has been merged into
`langchain-elastic`, its documentation is still to be maintained in the
main `langchain` repository. Therefore, this pull request adds the
documentation portion of `BM25RetrievalStrategy`.

The content of the documentation remains the same as that included in
the original PR, https://github.com/langchain-ai/langchain/pull/19314.

---------

Co-authored-by: Max Jakob <max.jakob@elastic.co>
3 months ago
David Lee 0394c6e126
community[minor]: add allow_dangerous_requests for OpenAPI toolkits (#19493)
**OpenAPI allow_dangerous_requests**: community: add
allow_dangerous_requests for OpenAPI toolkits

**Description:** a description of the change

Due to BaseRequestsTool changes, we need to pass
allow_dangerous_requests manually.


b617085af0/libs/community/langchain_community/tools/requests/tool.py (L26-L46)

While OpenAPI toolkits didn't pass it in the arguments.


b617085af0/libs/community/langchain_community/agent_toolkits/openapi/planner.py (L262-L269)


**Issue:** the issue # it fixes, if applicable

https://github.com/langchain-ai/langchain/issues/19440

If not passing allow_dangerous_requests, it won't be able to do
requests.

**Dependencies:** any dependencies required for this change

Not much

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
3 months ago
Guangdong Liu 301dc3dfd2
docs: Get rid of ZeroShotAgent and use create_react_agent instead (#20157)
- **Issue:** #20122
 -  @baskaryan, @eyurtsev.
3 months ago
Timothy 0c848a25ad
community[patch]: GCSDirectoryLoader bugfix (#20005)
- **Description:** Bug fix. Removed extra line in `GCSDirectoryLoader`
to allow catching Exceptions. Now also logs the file path if Exception
is raised for easier debugging.
- **Issue:** #20198 Bug since langchain-community==0.0.31
- **Dependencies:** No change
- **Twitter handle:** timothywong731

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
3 months ago
jeff kit ac42e96e4c
community[patch], langchain[minor]: Enhance Tencent Cloud VectorDB, langchain: make Tencent Cloud VectorDB self query retrieve compatible (#19651)
- make Tencent Cloud VectorDB support metadata filtering.
- implement delete function for Tencent Cloud VectorDB.
- support both Langchain Embedding model and Tencent Cloud VDB embedding
model.
- Tencent Cloud VectorDB support filter search keyword, compatible with
langchain filtering syntax.
- add Tencent Cloud VectorDB TranslationVisitor, now work with self
query retriever.
- more documentations.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
3 months ago
Bagatur 1a34c65e01
community[patch]: pass through sql agent kwargs (#19962)
Fix #19961
3 months ago
Haris Ali 1b480914b4
docs: Fix the class links in openai_tools and openai_functions description in output parser documentations (#20197)
- **Description:** In this PR I fixed the links which points to the API
docs for classes in OpenAI functions and OpenAI tools section of output
parsers.
  - **Issue:** It fixed the issue #19969

Co-authored-by: Haris Ali <haris.ali@formulatrix.com>
3 months ago
Guangdong Liu 97d91ec17c
community[patch]: standardize baichuan init args (#20209)
Related to https://github.com/langchain-ai/langchain/issues/20085

@baskaryan
3 months ago
Piyush Jain cd7abc495a
community[minor]: add neptune analytics graph (#20047)
Replacement for PR
[#19772](https://github.com/langchain-ai/langchain/pull/19772).

---------

Co-authored-by: Dave Bechberger <dbechbe@amazon.com>
Co-authored-by: bechbd <bechbd@users.noreply.github.com>
3 months ago
Shuqian ad9750403b
community[minor]: add bedrock anthropic callback for token usage counting (#19864)
**Description:** add bedrock anthropic callback for token usage
counting, consulted openai callback.

---------

Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com>
3 months ago
Prince Canuma 1f9f4d8742
community[minor]: Add support for MLX models (chat & llm) (#18152)
**Description:** This PR adds support for MLX models both chat (i.e.,
instruct) and llm (i.e., pretrained) types/
**Dependencies:** mlx, mlx_lm, transformers
**Twitter handle:** @Prince_Canuma

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
3 months ago
aditya thomas 6baeaf4802
docs: TogetherAI as a drop-in replacement for OpenAI (#19900)
**Description:** TogetherAI as a drop-in replacement for OpenAI
**Issue:** None
**Dependencies:** None

@baskaryan apropos #20032
3 months ago
Leonid Ganeline 2f8dd1a161
community[patch]: `cross_encoders` flatten namespaces (#20183)
Issue `langchain_community.cross_encoders` didn't have flattening
namespace code in the __init__.py file.
Changes:
- added code to flattening namespaces (used #20050 as a template)
- added ut for a change
- added missed `test_imports` for `chat_loaders` and
`chat_message_histories` modules
3 months ago
Bagatur 1af7133828
docs: add vertexai to structured output (#20171) 3 months ago
kaijietti a812839f0c
community: add request_timeout and max_retries to ChatAnthropic (#19402)
This PR make `request_timeout` and `max_retries` configurable for
ChatAnthropic.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Richmond Alake c769421aa4
cookbook: MongoDB Cookbook for Chat history and semantic cache (#19998)
Thank you for contributing to LangChain!

- [ ] **PR title**: "community: Add semantic caching and memory using
MongoDB"


- [ ] **PR message**: 
- **Description:** This PR introduces functionality for adding semantic
caching and chat message history using MongoDB in RAG applications. By
leveraging the MongoDBCache and MongoDBChatMessageHistory classes,
developers can now enhance their retrieval-augmented generation
applications with efficient semantic caching mechanisms and persistent
conversation histories, improving response times and consistency across
chat sessions.
    - **Issue:** N/A
- **Dependencies:** Requires `datasets`, `langchain`,
`langchain-mongodb`, `langchain-openai`, `pymongo`, and `pandas` for
implementation. MongoDB Atlas is used for database services, and the
OpenAI API for model access.
    - **Twitter handle:** @richmondalake

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Erick Friis 391e8f2050
pinecone[patch]: fix core min version (#20177) 3 months ago
Harry Jiang 1ee208541c
langchain: fix pinecone upsert when async_req is set to False (#19793)
Issue: 
When async_req is the default value True, pinecone client return the
multiprocessing AsyncResult object.
When async_req is set to False, pinecone client return the result
directly. `[{'upserted_count': 1}]` . Calling get() method will throw an
error in this case.
3 months ago
Alex Sherstinsky 5f563e040a
community: extend Predibase integration to support fine-tuned LLM adapters (#19979)
- [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**: ***Delete this entire checklist*** and replace
with
- **Description:** Langchain-Predibase integration was failing, because
it was not current with the Predibase SDK; in addition, Predibase
integration tests were instantiating the Langchain Community `Predibase`
class with one required argument (`model`) missing. This change updates
the Predibase SDK usage and fixes the integration tests.
    - **Twitter handle:** `@alexsherstinsky`


- [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, hwchase17.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Bagatur a27d88f12a
anthropic[patch]: standardize init args (#20161)
Related to #20085
3 months ago
Bagatur 3490d70238
mistralai[patch]: standardize model params (#20163)
Related to #20085
3 months ago
Bagatur 17182406f3
docs: standardize fireworks params (#20162)
Related to #20085
3 months ago
Bagatur 5ae0e687b3
docs: use standard openai params (#20160)
Part of #20085
3 months ago
david02871 e1a24d09c5
community: Add PHP language parser to document_loaders (#19850)
**Description:**
Added a PHP language parser to document_loaders
**Issue:** N/A
**Dependencies:** N/A
**Twitter handle:** N/A

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
3 months ago
Marlene 2f03bc397e
Community: Updating Azure Retriever and Docs to be Azure AI Search instead of Azure Cognitive Search (#19925)
Last year Microsoft [changed the
name](https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search)
of Azure Cognitive Search to Azure AI Search. This PR updates the
Langchain Azure Retriever API and it's associated docs to reflect this
change. It may be confusing for users to see the name Cognitive here and
AI in the Microsoft documentation which is why this is needed. I've also
added a more detailed example to the Azure retriever doc page.

There are more places that need a similar update but I'm breaking it up
so the PRs are not too big 😄 Fixing my errors from the previous PR.

Twitter: @marlene_zw

Two new tests added to test backward compatibility in
`libs/community/tests/integration_tests/retrievers/test_azure_cognitive_search.py`

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
3 months ago
Rahul Triptahi 820b713086
community[minor]: Add support for Pebblo cloud_api_key in PebbloSafeLoader (#19855)
**Description**:
_PebbloSafeLoader_: Add support for pebblo's cloud api-key in
PebbloSafeLoader

- This Pull request enables PebbloSafeLoader to accept pebblo's cloud
api-key and send the semantic classification data to pebblo cloud.

**Documentation**: Updated 
**Unit test**: Added
**Issue**: NA
**Dependencies**: - None
**Twitter handle**: @rahul_tripathi2

Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
3 months ago
Eugene Yurtsev 34a24d4df6
postgres[minor]: Add pgvector community as is (#20096)
This moves langchain pgvector community as is

The only modification is support for psycopg3 rather than psycopg2!
3 months ago
Eugene Yurtsev ba9e0d76c1
postgres[minor]: add postgres checkpoint implementation (#20025)
Adds checkpoint implementation using psycopg
3 months ago
William FH 039b7a472d
[core] fix: manually specifying run_id for chat models.invoke() and .ainvoke() (#20082) 3 months ago
Chris Germann ba602dc562
Documentation: Fixed the typo of Discord -> Telegram (#20008)
Description: Just fixed one string
Issues: None
Dependencies: None
Twitter handle: @epu9byj

Co-authored-by: gere <gere@kapo.zh.ch>
3 months ago
Erick Friis 96dc0ea49d
pinecone[patch]: release 0.1.0 (#20109) 3 months ago
donbr de496062b3
templates: migrate to langchain_anthropic package to support Claude 3 models (#19393)
- **Description:** update langchain anthropic templates to support
Claude 3 (iterative search, chain of note, summarization, and XML
response)
- **Issue:** issue # N/A. Stability issues and errors encountered when
trying to use older langchain and anthropic libraries.
- **Dependencies:**
  - langchain_anthropic version 0.1.4\
- anthropic package version in the range ">=0.17.0,<1" to support
langchain_anthropic.
- **Twitter handle:** @d_w_b7


- [ x]**Add tests and docs**: If you're adding a new integration, please
include
  1. used instructions in the README for testing

- [ 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, hwchase17.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Maxime Perrin 5ac0d1f67b
partners[anthropic]: fix anthropic chat model message type lookup keys (#19034)
- **Description:** Fixing message formatting issue in ChatAnthropic
model by adding dictionary keys for `AIMessageChunk `and
`HumanMessageChunk`
  - **Issue:** #19025 
  - **Twitter handle:** @maximeperrin_

Co-authored-by: Maxime Perrin <mperrin@doing.fr>
Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Krista Pratico d64bd32b20
templates: add rag azure search template (#18143)
- **Description:** Adds a template for performing RAG with the
AzureSearch vectorstore.
- **Issue:** N/A
- **Dependencies:** N/A
- **Twitter handle:** N/A

---------

Co-authored-by: Erick Friis <erickfriis@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
3 months ago
Bagatur 46f580d42d
docs: anthropic tool docstring (#20091) 3 months ago
Erick Friis 28dfde2cb2
cohere: move package to external repo (#20081) 3 months ago
Jacob Lee 58a2123ca0
docs[patch]: Add missing redirects (#20076) 3 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
3 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>
3 months ago
Eugene Yurtsev e4fc0e7502
core[patch]: Document BaseCache abstraction in code (#20046)
Document the base cache abstraction in the cache.
3 months ago
Christophe Bornet 4d8a6a27a3
core[minor]: Implement aformat_prompt and ainvoke in BasePromptTemplate (#20035) 3 months ago
Christophe Bornet 7e5c1905b1
core[minor]: Add async aformat_document method (#20037) 3 months ago