Commit Graph

6039 Commits (92b07ecaf32d4eff68ff80650ce57f7c4009f519)
 

Author SHA1 Message Date
Manuel Riezebosch 92b07ecaf3
DOCS: fix link to question answering (#13806)
first link in
[overview](https://python.langchain.com/docs/use_cases/question_answering/code_understanding#overview)
9 months ago
Assaf Toledo ba62ff89cc
BUGFIX: Support for elastic indices that don't return 'metadata' in '_source' (#13903)
Description: Some Elastic indexes do not return a 'metadata' field in
'_source'. However, prior to this PR, the code assumed there always is a
'metadata' field. This PR adds support for cases where the field is
missing by adding it manually.

Issue: #13869
9 months ago
Enric Soler Rastrollo c156d0281a
BUGFIX: Use embedding key in azure_cosmos_db index creation (#13919)
Description: Implement embedding key parametrisation
Issue: https://github.com/langchain-ai/langchain/issues/13918
Dependencies: None
Tag maintainer: @hwchase17 @izzymsft
Twitter handle:@MaddogoS
9 months ago
Bagatur ac67422a3d
IMPROVEMENT: import Document from core (#13905) 9 months ago
chyroc 886bc2d50a
IMPROVEMENT: fix qianfan validate_environment typo (#13908) 9 months ago
Chengzu Ou 4b8e053fe8
FEATURE: Add Databricks Vector Search as a new vector store (#13621)
**Description:**
This PR adds Databricks Vector Search as a new vector store in
LangChain.

- [x] Add `DatabricksVectorSearch` in `langchain/vectorstores/`
- [x] Unit tests
- [x] Add
[`databricks-vectorsearch`](https://pypi.org/project/databricks-vectorsearch/)
as a new optional dependency

We ran the following checks:
- `make format` passed  
- `make lint` failed but the failures were caused by other files
    + Files touched by this PR passed the linter  
- `make test` passed  
- `make coverage` failed but the failures were caused by other files.
Tests added by or related to this PR all passed
+ langchain/vectorstores/databricks_vector_search.py test coverage 94% 
- `make spell_check` passed  

The example notebook and updates to the [provider's documentation
page](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/databricks.md)
will be added later in a separate PR.

**Dependencies:**
Optional dependency:
[`databricks-vectorsearch`](https://pypi.org/project/databricks-vectorsearch/)

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Leonid Kuligin 25387db432
BUFIX: add support for various OSS images from Vertex Model Garden (#13917)
- **Description:** add support for various OSS images from Model
Garden
  - **Issue:** #13370
9 months ago
Eugene Yurtsev e186637921
Document Runnable Binding (#13927)
Document runnable binding
9 months ago
Bagatur 46b3311190
RELEASE: 0.0.341 (#13926) 9 months ago
Nuno Campos f6b05cacd0
Update root poetry lock with core (#13922)
<!-- Thank you for contributing to LangChain!

Replace this entire comment with:
  - **Description:** a description of the change, 
  - **Issue:** the issue # it fixes (if applicable),
  - **Dependencies:** any dependencies required for this change,
- **Tag maintainer:** for a quicker response, tag the relevant
maintainer (see below),
- **Twitter handle:** we announce bigger features on Twitter. If your PR
gets announced, and you'd like a mention, we'll gladly shout you out!

Please make sure your PR is passing linting and testing before
submitting. Run `make format`, `make lint` and `make test` to check this
locally.

See contribution guidelines for more information on how to write/run
tests, lint, etc:

https://github.com/langchain-ai/langchain/blob/master/.github/CONTRIBUTING.md

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/extras`
directory.

If no one reviews your PR within a few days, please @-mention one of
@baskaryan, @eyurtsev, @hwchase17.
 -->
9 months ago
umair mehmood b3e08f9239
improvement: fix chat prompt loading from config (#13818)
Add loader for loading chat prompt from config file.

fixed: #13667

@efriis 
@baskaryan
9 months ago
Nuno Campos 8a3e0c9afa
Add option to prefix config keys in configurable_alts (#13714) 9 months ago
Tomaz Bratanic 4ce5254442
Add Cypher template diagrams (#13913) 9 months ago
Taqi Jaffri bfc12a4a76
DOCS: Simplified Docugami cookbook to remove code now available in docugami library (#13828)
The cookbook had some code to upload files, and wait for the processing
to finish.

This code is now moved to the `docugami` library so removing from the
cookbook to simplify.

Thanks @rlancemartin for suggesting this when working on evals.

---------

Co-authored-by: Taqi Jaffri <tjaffri@docugami.com>
9 months ago
ggeutzzang 3749af79ae
DOCS: fixed error in the docstring of RunnablePassthrough class (#13843)
This pull request addresses an issue found in the example code within
the docstring of `libs/core/langchain_core/runnables/passthrough.py`

The original code snippet caused a `NameError` due to the missing import
of `RunnableLambda`. The error was as follows:
```
     12     return "completion"
     13 
---> 14 chain = RunnableLambda(fake_llm) | {
     15     'original': RunnablePassthrough(), # Original LLM output
     16     'parsed': lambda text: text[::-1] # Parsing logic

NameError: name 'RunnableLambda' is not defined
```
To resolve this, I have modified the example code to include the
necessary import statement for `RunnableLambda`. Additionally, I have
adjusted the indentation in the code snippet to ensure consistency and
readability.

The modified code now successfully defines and utilizes
`RunnableLambda`, ensuring that users referencing the docstring will
have a functional and clear example to follow.

There are no related GitHub issues for this particular change.

Modified Code:
```python
from langchain_core.runnables import RunnablePassthrough, RunnableParallel
from langchain_core.runnables import RunnableLambda

runnable = RunnableParallel(
    origin=RunnablePassthrough(),
    modified=lambda x: x+1
)

runnable.invoke(1) # {'origin': 1, 'modified': 2}

def fake_llm(prompt: str) -> str: # Fake LLM for the example
    return "completion"

chain = RunnableLambda(fake_llm) | {
    'original': RunnablePassthrough(), # Original LLM output
    'parsed': lambda text: text[::-1] # Parsing logic
}

chain.invoke('hello') # {'original': 'completion', 'parsed': 'noitelpmoc'}
```

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Dylan Williams 1983a39894
FEATURE: Add OneNote document loader (#13841)
- **Description:** Added OneNote document loader
  - **Issue:** #12125
  - **Dependencies:** msal

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Ikko Eltociear Ashimine ff7d4d9c0b
Update llamacpp.ipynb (#13840)
specifed -> specified
9 months ago
Tomaz Bratanic 1ad65f7a98
BUGFIX: Fix bugs with Cypher validation (#13849)
Fixes https://github.com/langchain-ai/langchain/issues/13803. Thanks to
@sakusaku-rich
9 months ago
Sᴜᴘᴇʀ Lᴇᴇ e42e95cc11
docs: fix link to `local_retrieval_qa` (#13872)
\The original link in [this
section](https://python.langchain.com/docs/use_cases/question_answering/#:~:text=locally%2Drunning%20models-,here,-.):

https://python.langchain.com/docs/modules/use_cases/question_answering/local_retrieval_qa

After fix:

https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa
9 months ago
Harrison Chase 6a35831128
BUGFIX: export more types (#13886)
Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Yusuf Khan 935f78c944
FEATURE: Add retriever for Outline (#13889)
- **Description:** Added a retriever for the Outline API to ask
questions on knowledge base
  - **Issue:** resolves #11814
  - **Dependencies:** None
  - **Tag maintainer:** @baskaryan
9 months ago
ggeutzzang f2af82058f
DOCS: Fix Sample Code for Compatibility with Pydantic 2.0 (#13890)
- **Description:** 
I encountered an issue while running the existing sample code on the
page https://python.langchain.com/docs/modules/agents/how_to/agent_iter
in an environment with Pydantic 2.0 installed. The following error was
triggered:

```python
ValidationError                           Traceback (most recent call last)
<ipython-input-12-2ffff2c87e76> in <cell line: 43>()
     41 
     42 tools = [
---> 43     Tool(
     44         name="GetPrime",
     45         func=get_prime,

2 frames
/usr/local/lib/python3.10/dist-packages/pydantic/v1/main.py in __init__(__pydantic_self__, **data)
    339         values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data)
    340         if validation_error:
--> 341             raise validation_error
    342         try:
    343             object_setattr(__pydantic_self__, '__dict__', values)

ValidationError: 1 validation error for Tool
args_schema
  subclass of BaseModel expected (type=type_error.subclass; expected_class=BaseModel)
```

I have made modifications to the example code to ensure it functions
correctly in environments with Pydantic 2.0.
9 months ago
Harrison Chase 968ba6961f
add skeleton of thought (#13883) 9 months ago
Bagatur 0efa59cbb8
RELEASE: 0.0.339rc3 (#13852) 9 months ago
Bagatur 7222c42077
RELEASE: core 0.0.6 (#13853) 9 months ago
raelix c172605ea6
IMPROVEMENT: Added title metadata to GoogleDriveLoader for optional File Loaders (#13832)
- **Description:** Simple change, I just added title metadata to
GoogleDriveLoader for optional File Loaders
  - **Dependencies:** no dependencies
  - **Tag maintainer:** @hwchase17

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Stefano Lottini 19c68c7652
FEATURE: Astra DB, LLM cache classes (exact-match and semantic cache) (#13834)
This PR provides idiomatic implementations for the exact-match and the
semantic LLM caches using Astra DB as backend through the database's
HTTP JSON API. These caches require the `astrapy` library as dependency.

Comes with integration tests and example usage in the `llm_cache.ipynb`
in the docs.

@baskaryan this is the Astra DB counterpart for the Cassandra classes
you merged some time ago, tagging you for your familiarity with the
topic. Thank you!

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago
Stefano Lottini 272df9dcae
Astra DB, chat message history (#13836)
This PR adds a chat message history component that uses Astra DB for
persistence through the JSON API.
The `astrapy` package is required for this class to work.

I have added tests and a small notebook, and updated the relevant
references in the other docs pages.

(@rlancemartin this is the counterpart of the Cassandra equivalent class
you so helpfully reviewed back at the end of June)

Thank you!
9 months ago
Bagatur 58f7e109ac
BUGFIX: Add import types and typevars from core (#13829) 9 months ago
Bagatur 751226e067
bump 0.0.339rc2 (#13787) 9 months ago
Bagatur 300ff01824
RELEASE: core 0.0.5 (#13786) 9 months ago
Bagatur bcf83988ec
Revert "INFRA: temp rm master condition (#13753)" (#13759) 9 months ago
Bagatur df471b0c0b
INFRA: temp rm master condition (#13753) 9 months ago
Bagatur 72c108b003
IMPROVEMENT: filter global warnings properly (#13754) 9 months ago
William FH 163bf165ed
Add Batch Size kwarg to the llm start callback (#13483)
So you can more easily use the token counts directly from the API
endpoint for batch size of 1
9 months ago
Bagatur 23566cbea9
DOCS: core editable dep api refs (#13747) 9 months ago
Bagatur 0be515f720
RELEASE: 0.0.339rc1 (#13746) 9 months ago
Bagatur 2bc5bd67f7
RELEASE: core 0.0.4 (#13745) 9 months ago
Bagatur b6b7654f7f
INFRA: run LC ci after core changes (#13742) 9 months ago
Bagatur 3d28c1a9e0
DOCS: fix core api ref build (#13744) 9 months ago
Bagatur 32d087fcb8
REFACTOR: combine core documents files (#13733) 9 months ago
h3l 14d4fb98fc
DOCS: Fix typo/line break in python code (#13708) 9 months ago
William FH 5b90fe5b1c
Fix locking (#13725) 9 months ago
Bagatur 16af282429
BUGFIX: add prompt imports for backwards compat (#13702) 9 months ago
Erick Friis 78da34153e
TEMPLATES Metadata (#13691)
Co-authored-by: Lance Martin <lance@langchain.dev>
9 months ago
Bagatur e327bb4ba4
IMPROVEMENT: Conditionally import core type hints (#13700) 9 months ago
dandanwei d47ee1ae79
BUGFIX: redis vector store overwrites falsey metadata (#13652)
- **Description:** This commit fixed the problem that Redis vector store
will change the value of a metadata from 0 to empty when saving the
document, which should be an un-intended behavior.
  - **Issue:** N/A
  - **Dependencies:** N/A
9 months ago
Bagatur a21e84faf7
BUGFIX: llm backwards compat imports (#13698) 9 months ago
Yujie Qian ace9e64d62
IMPROVEMENT: VoyageEmbeddings embed_general_texts (#13620)
- **Description:** add method embed_general_texts in VoyageEmebddings to
support input_type
  - **Issue:** 
  - **Dependencies:** 
  - **Tag maintainer:** 
  - **Twitter handle:** @Voyage_AI_
9 months ago
tanujtiwari-at 5064890fcf
BUGFIX: handle tool message type when converting to string (#13626)
**Description:** Currently, if we pass in a ToolMessage back to the
chain, it crashes with error

`Got unsupported message type: `

This fixes it. 

Tested locally

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
9 months ago