delayedkarma/langchain-issues huggingface dataset:
Support for Gradient.ai embedding
Labels: name: area: embeddings, name: auto:enhancement

Adds support for gradient.ai's embedding model.

This will remain a Draft, as the code will likely be refactored with the `pip install gradientai` python sdk.

<!-- 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/hwchase17/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.
 -->
add support for passing of ids in from_texts in OpenSearch vector store
Labels: name: area: vector store, name: auto:improvement

### Feature request

Currently in OpenSearch vector store while using the function `from_texts` it doesn't take `ids` as a parameter, so if multiple times the code is run for same documents the data gets duplicated. Which results in duplicated response being returned.

To fix this we just need to pass `ids` as optional parameter in the function. which should then be passed to add_embeddings function.

This is similar to what we are doing in add_texts function.

### Motivation

if multiple times the code is run for same documents the data gets duplicated. Which results in duplicated response being returned.


### Your contribution

@naveentatikonda who work on the integration can do this.
Fixes error with providers that don't have model_id
Labels: name: lgtm, name: auto:bug, name: area: models

## Description
Fixes error with using the chain for providers that don't have `model_id` field.

![image](https://github.com/langchain-ai/langchain/assets/289369/a86074cf-6c99-4390-a135-b3af7a4f0827)
Authentication to HuggingFaceTextGenInference API running on custom server
Labels: name: auto:question, name: auto:documentation, name: area: models

### Issue you'd like to raise.

Hello everyone,

I have HuggingFaceTextGenInference API running on my server with **authentication token**. I would like to call this API through Langchain. So, I am using the following code:

```
from langchain.llms import HuggingFaceTextGenInference

llm = HuggingFaceTextGenInference(
    inference_server_url="url",
    max_new_tokens=512,
    top_k=10,
    top_p=0.95,
    typical_p=0.95,
    temperature=0.01,
    repetition_penalty=1.03,
)
```
My question is: how can we pass the **authentication token as argument** in order to call the API. The documentation is not clear on how to do that.

### Suggestion:

_No response_
Add metadata in embeddings for VectorStoreRetrieverMemory
Labels: name: area: memory, name: auto:improvement

  - **Description:** This PR allows to attach metadata to vector store embeddings when used as a retriever for the VectorStoreRetrieverMemory class, 
  - **Issue:** #9067,
  - **Twitter handle:** [@rafacanvaz](https://twitter.com/rafacanvaz)
  
@hwchase17 @eyurtsev @baskaryan
GradientLLM Docs update and model_id renaming.
Labels: name: auto:documentation, name: area: models

Related to #10800 

- Errors in the Docstring of GradientLLM / Gradient.ai LLM
- Renamed the `model_id` to `model` and adapting this in all tests. Reason to so is to be in Sync with `GradientEmbeddings` and other LLM's.
- inmproving tests so they check the headers in the sent request.
- making the aiosession a private attribute in the docs, as in the future `pip install gradientai` will be replacing aiosession.
- adding a example how to fine-tune on the Prompt  Template as suggested in #10800 

<!-- 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/hwchase17/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.
 -->
I just got here from a Twitter link that a colleague sent me (https://twitter.com/llm_sec/status/1668711587287375876?s=20). I'm only a causal observer (not a Langchain user or contributor), but I thought it might be good to drop these links in case you're unaware of the ways that attackers can escape from AST-based Python "sandboxes":
Labels: name: auto:bug

              I just got here from a Twitter link that a colleague sent me (https://twitter.com/llm_sec/status/1668711587287375876?s=20). I'm only a causal observer (not a Langchain user or contributor), but I thought it might be good to drop these links in case you're unaware of the ways that attackers can escape from AST-based Python "sandboxes":

https://hacktricks.boitatech.com.br/misc/basic-python/bypass-python-sandboxes
https://github.com/mahaloz/ctf-wiki-en/blob/master/docs/pwn/linux/sandbox/python-sandbox-escape.md

The strategies in these links aren't exhaustive, but hopefully illustrate that this style of sandboxing makes attacks more complex without defeating them entirely.

_Originally posted by @qxcv in https://github.com/langchain-ai/langchain/issues/6003#issuecomment-1590176952_
Typo fix to MathpixPDFLoader - changed processed_file_format default …
Labels: name: lgtm, name: area: doc loader, name: auto:bug

…from mmd to md. https://github.com/langchain-ai/langchain/issues/7282

<!-- 
  - **Description:** minor fix to a breaking typo - MathPixPDFLoader processed_file_format is "mmd" by default, doesn't work, changing to "md" fixes the issue, 
  - **Issue:** 7282 (https://github.com/langchain-ai/langchain/issues/7282),
  - **Dependencies:** none,
  - **Tag maintainer:** @hwchase17,
  - **Twitter handle:** none
 -->
LLMRails Embedding
Labels: name: lgtm, name: area: embeddings, name: auto:enhancement

LLMRails  Embedding Integration
This PR provides integration with LLMRails. Implemented here are:

langchain/embeddings/llm_rails.py
docs/extras/integrations/text_embedding/llm_rails.ipynb


Hi @hwchase17 after adding our vectorstore integration to langchain with confirmation of you and @baskaryan, now we want to add our embedding integration
Update Serializable to use classmethods
Labels: name: auto:improvement

The goal of this PR is to update Serializable object to use classmethods rather than isinstance checks to determine: 

(1) is the type serializable
(2) what is its namespace

Secerts and attributes can stay instance level properties

These both should be class level properties rather than instance level properties and will ease in impelementing validation based on type when loading data.

Goal: 

```python

def loads(serialized_representation, allow_list=Sequence[Type[Serializable]]): 
   ...

loads(..., [HumanMessage, AIMessage]) -> would only allow de-serialization of human message or AI message
```
Issue: getting ValueError(f"One output key expected, got {outputs.keys()}") in a ConversationalRetrievalChain  call
Labels: name: auto:bug, name: area: models

### Issue you'd like to raise.

Not sure this is the right place to raise this, but I'm having difficulty with the return value of ConversationalRetrievalChain (called "qa" in my code) when return_source_documents=True.  The object returned is (I believe) a python dictionary object with two keys, "answer" and "source_documets". When I  execute the folllwing line <output = self.qa({"question": question})> I get an error back that reads ValueError(f"One output key expected, got {outputs.keys()}").

Any help on why this is happening and how I can fix?

### Suggestion:

_No response_
Issue: GPT4AllEmbeddings() throwing GGML Assert Error
Labels: name: area: embeddings, name: area: vector store, name: auto:bug, name: integration: chroma

### GPT4AllEmbeddings() throwing GGML Assert Error

I am trying to follow this use case 
https://python.langchain.com/docs/use_cases/question_answering/how_to/local_retrieval_qa
This was working till yesterday, Today its not working

```
from langchain.vectorstores import Chroma
from langchain.embeddings import GPT4AllEmbeddings

vectorstore = Chroma.from_documents(documents=all_splits, embedding=GPT4AllEmbeddings())
```


Console error: 
```
Found model file at  C:\Users\saura\.cache\gpt4all\ggml-all-MiniLM-L6-v2-f16.bin
GGML_ASSERT: C:\Users\circleci\project\gpt4all-backend\llama.cpp-mainline\ggml.c:8027: ggml_nelements(dst) == ggml_nelements(src0)
```

### Suggestion:

_No response_
Support using async callback handlers with sync callback manager
Labels: name: auto:improvement

The current behaviour just calls the handler without awaiting the coroutine, which results in exceptions/warnings, and obviously doesn't actually execute whatever the callback handler does

<!-- 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/hwchase17/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.
 -->
duplicate validator function
Labels: name: area: doc loader, name: auto:bug

### System Info

Using langchain==0.0.299 in Ubuntu 22.04.1 LTS (GNU/Linux 5.19.0-1028-aws x86_64). I get the following error: 

pydantic.errors.ConfigError: duplicate validator function "langchain.document_loaders.embaas.BaseEmbaasLoader.validate_environment"; if this is intended, set `allow_reuse=True`

I'm not importing pydantic separately, to make sure that I’m not creating this conflict. Nonetheless, I’m unable to resolve this unless this is updated in your code base. Thank you.

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Simply importing LangChain is causing this error.

### Expected behavior

The library should import if there is no dependency or conflict with other libraries.
bump 300
Labels: name: auto:nit

<!-- 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/hwchase17/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.
 -->
update feat table
Labels: name: auto:documentation, name: area: models

<!-- 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/hwchase17/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.
 -->
In MergerRetriever async call all retrievers in parallel
Labels: name: auto:improvement

<!-- 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/hwchase17/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.
 -->
Remove python eval from vector sql db chain
Labels: name: area: vector store, name: auto:improvement

<!-- 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/hwchase17/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.
 -->
"afrom_texts" method implemented for vectordb base
Labels: name: area: vector store, name: auto:improvement

<!-- 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/hwchase17/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.
 -->
Accept run name arg for non-chain runs
Labels: name: auto:improvement, name: area: models

<!-- 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/hwchase17/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.
 -->
Aleph Alpha Async Embeddings (as a context manager) 
Labels: name: lgtm, name: area: embeddings, name: auto:improvement

Replace this entire comment with:
  - **Description:** Updated the Aleph Alpha Embeddings to support async calls. The async call is execured as a contex manager, example in the documentation
  - **Issue:** Much faster execution of tha calls, cause we can send multiple calls at the same time
  - **Dependencies:** no
  - **Twitter handle:** None

Also added the docs showing how to use it.
Add ElasticsearchChatMessageHistory
Labels: name: area: memory, name: lgtm, name: auto:enhancement

**Description**

This PR adds the `ElasticsearchChatMessageHistory` implementation that stores chat message history in the configured [Elasticsearch](https://www.elastic.co/elasticsearch/) deployment.

```python
from langchain.memory.chat_message_histories import ElasticsearchChatMessageHistory

history = ElasticsearchChatMessageHistory(
    es_url="https://my-elasticsearch-deployment-url:9200", index="chat-history-index", session_id="123"
)

history.add_ai_message("This is me, the AI")
history.add_user_message("This is me, the human")
```

**Dependencies**
- [elasticsearch client](https://elasticsearch-py.readthedocs.io/) required


<!-- Thank you for contributing to LangChain!
TODO: **Tag maintainer:** for a quicker response, tag the relevant maintainer (see below),

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!

If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17.
 -->
OutputParserException: Could not parse LLM output: `The dataframe has a mix of integer and object data types.`
Labels: name: auto:bug, name: area: models

### System Info

When I ask the agent what kind of data does the pandas dataframe has. It gave me this error. I wanted to know what did the rows indicate and what could the LLM make out of the data. Like is it a financial data or some sales data.

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [X] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Load a data and ask what kind of data does the dataframe has

### Expected behavior

It should give the kind of data it was fed
Add base docker image and ci script for building and pushing
Labels: name: auto:enhancement

<!-- 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/hwchase17/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.
 -->