delayedkarma/langchain-issues huggingface dataset:
ElasticVectorSearch Error similarity_search openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
Labels: name: area: vector store, name: auto:bug, name: integration: elasticsearch

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

My code was fully working till i updated from 0.0.259 to 0.1.0 langchain

```
    embeddings = OpenAIEmbeddings(openai_api_key=os.environ["OPENAI_API_KEY"], 
                                model=os.environ["AZUREOPENAI_EMBEDDINGS_MODEL"], 
                                deployment=os.environ["AZUREOPENAI_EMBEDDINGS_DEPLOYMENT"])
    
    db = ElasticVectorSearch(
        embedding=embeddings,
        elasticsearch_url=url,
        index_name=os.environ["AZUREOPENAI_INDEX_NAME"],
        ssl_verify={"ca_certs": os.environ["APP_CERT_PATH"]}
    )
    docs = db.similarity_search(query=query,  # new
                                k=10)

    # Here is when it crashes
```

### Description

The code is crashing giving a weird error and It looks it is because of similarity_search doesnt work in the new version

### System Info

aiohttp==3.9.1
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.2.0
async-timeout==4.0.3
attrs==23.2.0
certifi==2023.11.17
charset-normalizer==3.3.2
click==8.1.7
dataclasses-json==0.6.3
distro==1.9.0
elastic-transport==8.11.0
elasticsearch==8.11.1
exceptiongroup==1.2.0
fastapi==0.109.0
frozenlist==1.4.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.2
httpx==0.26.0
idna==3.6
jsonpatch==1.33
jsonpointer==2.4
langchain==0.1.0
langchain-community==0.0.12
langchain-core==0.1.10
langsmith==0.0.80
marshmallow==3.20.2
multidict==6.0.4
mypy-extensions==1.0.0
numpy==1.26.3
openai==1.7.2
packaging==23.2
pydantic==2.5.3
pydantic_core==2.14.6
PyYAML==6.0.1
regex==2023.12.25
requests==2.31.0
sniffio==1.3.0
SQLAlchemy==2.0.25
starlette==0.35.1
tenacity==8.2.3
tiktoken==0.5.2
tqdm==4.66.1
typing-inspect==0.9.0
typing_extensions==4.9.0
urllib3==2.1.0
uvicorn==0.25.0
yarl==1.9.4

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [X] Callbacks/Tracing
- [ ] Async
community: add StreamingAPIGatewayWebSocketCallbackHandler
Labels: name: auto:enhancement, name: integration: aws, name: size:L

  - **Description:** add a community callback handler `StreamingAPIGatewayWebSocketCallbackHandler`, which is useful for serverless applications on AWS to streaming LLM's response to clients via AWS API Gateway WebSocket API and AWS Lambda.
  - **Issue:** N/A
  - **Dependencies:** N/A
  - **Twitter handle:** N/A
Unable to install langchain-google-genai
Labels: name: auto:bug, name: area: models

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

pip install langchain-google-genai

### Description

I am trying to install langchain-google-genai package, however getting below error:

ERROR: Could not find a version that satisfies the requirement langchain-google-genai==0.0.5 (from versions: none)
ERROR: No matching distribution found for langchain-google-genai==0.0.5

### System Info

python 3.8.3

### Related Components

- [X] 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
DOC: <Please write a comprehensive title after the 'DOC: ' prefix>
Labels: name: area: embeddings, name: auto:documentation

### Issue with current documentation:

https://python.langchain.com/docs/integrations/text_embedding/together

import is incorrect in documentation
```python
from langchain_together.embeddings import TogetherEmbeddings

embeddings = TogetherEmbeddings(model="togethercomputer/m2-bert-80M-8k-retrieval")
```

### Idea or request for content:

update to:
```python
from langchain_together import TogetherEmbeddings <------------ this line changed

embeddings = TogetherEmbeddings(model="togethercomputer/m2-bert-80M-8k-retrieval")
```
community: Fixing WARNING by providing embedding_function in collection creation
Labels: name: area: vector store, name: auto:improvement, name: integration: chroma, name: size:XS

**Description:** 
Resolved the WARNING message that occurred due to the absence of the embedding_function parameter during the creation of a collection. Updated the code to include the embedding_function parameter in the collection creation process.

**Issue:** #15400 

**Dependencies:** None
langchain_community: SQL Database - Don't assume "PostgreSQL" in the else
Labels: name: auto:improvement, name: area: lcel

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

Following code in https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/utilities/sql_database.py from line 386:
```
        with self._engine.begin() as connection:  # type: Connection
            if self._schema is not None:
                if self.dialect == "snowflake":
                    connection.exec_driver_sql(
                        "ALTER SESSION SET search_path = %s", (self._schema,)
                    )
                elif self.dialect == "bigquery":
                    connection.exec_driver_sql("SET @@dataset_id=?", (self._schema,))
                elif self.dialect == "mssql":
                    pass
                elif self.dialect == "trino":
                    connection.exec_driver_sql("USE ?", (self._schema,))
                elif self.dialect == "duckdb":
                    # Unclear which parameterized argument syntax duckdb supports.
                    # The docs for the duckdb client say they support multiple,
                    # but `duckdb_engine` seemed to struggle with all of them:
                    # https://github.com/Mause/duckdb_engine/issues/796
                    connection.exec_driver_sql(f"SET search_path TO {self._schema}")
                elif self.dialect == "oracle":
                    connection.exec_driver_sql(
                        f"ALTER SESSION SET CURRENT_SCHEMA = {self._schema}"
                    )
                elif self.dialect == "sqlany":
                    # If anybody using Sybase SQL anywhere database then it should not
                    # go to else condition. It should be same as mssql.
                    pass
                else:  # postgresql and other compatible dialects
                    connection.exec_driver_sql("SET search_path TO %s", (self._schema,))
```

### Description

Can we change the code of line 412:
```
                else:  # postgresql and other compatible dialects
                    connection.exec_driver_sql("SET search_path TO %s", (self._schema,))
```

to 

```
elif self.dialect == "postgresql":
  connection.exec_driver_sql("SET search_path TO %s", (self._schema,))
else:
  pass # Do nothing
```

It is in my opinion simply wrong to assume that any other DB will work like PostgreSQL. And it's not possible to cut that statement in the dialect easily. If we need more `elif`, so be it.

### System Info

Python 3.10 - it's independent of the Python version or environment.

### 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
community: fix a bug that mistakenly handle zip iterator in FAISS.from_embeddings
Labels: name: lgtm, name: area: vector store, name: auto:bug, name: size:XS

**Description**: `zip` is iterator that will only produce result once, so the previous code will cause the `embeddings` to be an empty list. 

**Issue**: I could not find a related issue.

**Dependencies**: this PR does not introduce or affect dependencies.
langchain: Indexing with `ParentDocumentRetriever`
Labels: name: area: vector store, name: auto:improvement, name: integration: pinecone, name: size:L

  - **Description:** Support using indexing along with `ParentDocumentRetriever`. In short, when you create a `ParentDocumentRetriever`, you can provide the arguments you would have provided to `index`. Then when you call `.add_documents`, `index` will be called with the provided arguments instead of directly persisting to the vector store.

This change also allows you to optionally provide a list of text splitters to `.add_documents` (being the same length as the list of documents), in case a single text splitter type for all docs that go through the receiver isn't appropriate.
retriever=retriever has a yellow underline, unable to perform the retrieval of vector database function
Labels: name: area: vector store, name: auto:bug

### Issue with current documentation:

import os
from langchain.chat_models import ChatOpenAI
from langchain.chains import ConversationalRetrievalChain
from langchain.memory import ConversationTokenBufferMemory
from langchain_community.embeddings import HuggingFaceEmbeddings
from langchain_community.vectorstores.qdrant import Qdrant
from langchain_core.prompts import ChatPromptTemplate, SystemMessagePromptTemplate, MessagesPlaceholder, \
    HumanMessagePromptTemplate
from qdrant_client import QdrantClient

os.environ['OPENAI_API_KEY'] = "key"
client = QdrantClient(host="192.168.0.312", port=6333)
COLLECTION_NAME = "embed"
embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
vectorstore = Qdrant(
    client=client,
    collection_name=COLLECTION_NAME,
    embeddings=embeddings
)
prompt = ChatPromptTemplate(
    messages=[
        SystemMessagePromptTemplate.from_template(
            "You are robot."
        ),
        MessagesPlaceholder(variable_name="chat_history"),
        HumanMessagePromptTemplate.from_template("{question}"),
    ]
)
llm_name = "gpt-3.5-turbo"
llm = ChatOpenAI(model_name=llm_name, temperature=0)
memory_token_limit = 100
retriever = vectorstore.as_retriever()
memory = ConversationTokenBufferMemory(
    llm=llm,
    prompt=prompt,
    max_token_limit=int(memory_token_limit),
    memory_key="chat_history",
    return_messages=True,
)

qa = ConversationalRetrievalChain.from_llm(
    llm=llm,
    retriever=retriever,
    memory=memory,
    verbose=True,
)

chat_history = []
while True:
    memory.load_memory_variables({"chat_history": chat_history})
    question = input('提問：')
    result = qa.run({'question': question, 'chat_history': chat_history})
    print(result)
    chat_history.append([f'User: {question}', f'Ai: {result}'])
    print(chat_history)
    if question.lower() == 'bye':
        break
![image](https://github.com/langchain-ai/langchain/assets/103471919/815f0775-676c-4a05-aff2-ddba1961c66b)


### Idea or request for content:

During each round of questioning, OpenAI will retrieve and reference similar conversation histories from a vector database before providing a response
community: New documents loader for visio files (with extension .vsdx)
Labels: name: area: doc loader, name: auto:enhancement, name: size:XL

**Description** : New documents loader for visio files (with extension .vsdx)

A [visio file](https://fr.wikipedia.org/wiki/Microsoft_Visio) (with extension .vsdx) is associated with Microsoft Visio, a diagram creation software. It stores information about the structure, layout, and graphical elements of a diagram. This format facilitates the creation and sharing of visualizations in areas such as business, engineering, and computer science.

A Visio file can contain multiple pages. Some of them may serve as the background for others, and this can occur across multiple layers. This **loader** extracts the textual content from each page and its associated pages, enabling the extraction of all visible text from each page, similar to what an OCR algorithm would do.

**Dependencies** : xmltodict package
fix(langchain): force ReAct agent to stop after final answer
Labels: name: area: agent, name: auto:bug, name: size:S

  - **Description:** ReAct agents often fail when used with completion models because they don't stop after providing the final answer. Specifically, the chain continues because the LLM hallucinates newer questions. This PR makes "Question" a default stop sequence for a react agent.
  
<!-- Thank you for contributing to LangChain!

Please title your PR "<package>: <description>", where <package> is whichever of langchain, community, core, experimental, etc. is being modified.

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,
  - **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` from the root of the package you've modified to check this locally.

See contribution guidelines for more information on how to write/run tests, lint, etc: https://python.langchain.com/docs/contributing/

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.

If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17.
 -->
WeaviateHybridSearchRetriever docs result in error
Labels: name: integration: weaviate, name: area: embeddings, name: auto:bug

### Issue with current documentation:

I'm basically running the same code as [Weaviate Hybrid Search](https://python.langchain.com/docs/integrations/retrievers/weaviate-hybrid):

```python

import os
import dotenv
import weaviate
from langchain.retrievers.weaviate_hybrid_search import WeaviateHybridSearchRetriever
from langchain.schema import Document

dotenv.load_dotenv()

# using an existing weaviate database (definitely works with llama-index)
client = weaviate.Client(
    url="http://34.170.94.90",
    auth_client_secret=weaviate.AuthApiKey(os.environ["WEAVIATE_API_KEY"]),
    additional_headers={
        "X-Openai-Api-Key": os.getenv("OPENAI_API_KEY"),
    },
)

retriever = WeaviateHybridSearchRetriever(
    client=client,
    index_name="LangChain",
    text_key="text",
    attributes=[],
    create_schema_if_missing=True,
)
```

The error:

```
UnexpectedStatusCodeException             Traceback (most recent call last)
 Cell 4 line 1
----> [1] retriever = WeaviateHybridSearchRetriever(
      [2]     client=client,
      [3]     index_name="LangChain",
      [4]     text_key="text",
      [5]     attributes=[],
      [6]     create_schema_if_missing=True,
      [7] 

File  usr/local/lib/python3.9/site-packages/langchain_core/load/serializable.py:107 /usr/local/lib/python3.9/site-packages/langchain_core/load/serializable.py:107), in Serializable.__init__(self, **kwargs)
    106 def __init__(self, **kwargs: Any) -> None:
--> 107     super().__init__(**kwargs)
    108     self._lc_kwargs = kwargs

File [usr/local/lib/python3.9/site-packages/pydantic/v1/main.py:339, in BaseModel.__init__(__pydantic_self__, **data)
    333 """
    334 Create a new model by parsing and validating input data from keyword arguments.
    335 
    336 Raises ValidationError if the input data cannot be parsed to form a valid model.
    337 """
    338 # Uses something other than `self` the first arg to allow "self" as a settable attribute
--> 339 values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data)
    340 if validation_error:
...
    814     raise RequestsConnectionError("Class may not have been created properly.") from conn_err
    815 if response.status_code != 200:
--> 816     raise UnexpectedStatusCodeException("Create class", response)

UnexpectedStatusCodeException: Create class! Unexpected status code: 422, with response body: {'error': [{'message': 'vectorizer: no module with name "text2vec-openai" present'}]}.
```

I'm using:

```
python-dotenv==1.0.0
langchain==0.1.0
openai==1.7.2
langchain-openai==0.0.2.post1
weaviate-client==3.26.0
```

### Idea or request for content:

It appears that the docs are out-of-date, at least for:

```
langchain==0.1.0
openai==1.7.2
weaviate-client==3.26.0
```
unclear docs for using existing Weaviate database
Labels: name: integration: weaviate, name: area: vector store, name: auto:documentation

### Issue with current documentation:

The [Weaviate docs](https://python.langchain.com/docs/integrations/vectorstores/weaviate) just show examples of using `Weaviate.from_documents()` or `Weaviate.from_texts()`, but do not describe how to use an existing database with embedded documents already stored in the database. 

Moreover, the descriptions of the `index_name` or `text_key` that are required when calling `Weaviate()` are not described anywhere in the [Weaviate docs](https://python.langchain.com/docs/integrations/vectorstores/weaviate), and `index_name` seems to be very misleading, given that it should be the name of the Weaviate *class*. 

A naive attempt of:

```python
import os
import dotenv
import weaviate
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_community.vectorstores import Weaviate
from langchain_core.runnables import RunnablePassthrough

dotenv.load_dotenv()

llm = ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo")

client = weaviate.Client(
    url="http://34.170.94.90",
    auth_client_secret=weaviate.AuthApiKey(os.environ["WEAVIATE_API_KEY"])
)

db = Weaviate(client, 'my_class_name', 'text')

retriever = db.as_retriever()

chain = (
    {"context": retriever, "question": RunnablePassthrough()}
    | prompt 
    | llm 
    | output_parser
)

chain.invoke({"input" : "My particular query"})
```

Results in the error:

```
ValueError: Error during query: [{'locations': [{'column': 46, 'line': 1}], 'message': 'Syntax Error GraphQL request (1:46) Expected Name, found String "input"\n\n1: {Get{my_class_name(limit: 4 nearText: {concepts: [{"input": "My particular query"}]} ){text}}}\n                                                ^\n', 'path': None}]
```

...which isn't too helpful on understanding the issue. 

Note: I did actually use the correct class name instead of `my_class_name`. 

### Idea or request for content:

It would be very helpful to include an example of using an existing Weaviate database, which included inspecting the DB schema to determine the values to use for `index_name` and `text_key`.
KeyError: 'intermediate_steps' when using Wikipedia tool within the create_react_agent function
Labels: name: area: agent, name: auto:bug

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

```
from langchain import hub

from langchain.agents import create_react_agent
from langchain.tools import Tool
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
from langchain_community.llms.openai import OpenAI

instructions = """You are an agent designed to write and execute python code to answer questions.
You have access to Wikipedia, which you can use to search informations.
Be smart and select the correct wikipedia for a specific search when several are available.
"""
base_prompt = hub.pull("langchain-ai/react-agent-template")
prompt = base_prompt.partial(instructions=instructions)

wiki = WikipediaAPIWrapper()
wiki_tool = Tool(
    name="wikipedia",
    description="A wikipedia tool that allow to search in it",
    func=wiki.run,
)

agent = create_react_agent(OpenAI(name="gpt-3.5-turbo", temperature=0), tools=[wiki_tool], prompt=prompt)
print(agent.invoke({"input":"What is Nostradamus know for"}) )
```

### Description

I was trying to use the Wikipedia tool in a ReAct agent. I thought it will run smoothly but a KeyError intermediate_step trigged

### System Info

langchain                                0.1.0
langchain-community            0.0.12
langchain-core                       0.1.10
langchain-experimental         0.0.49
langchainhub                         0.1.14
langsmith                               0.0.80
wikipedia                                1.4.0

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [X] Agents / Agent Executors
- [X] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async
community: implement adelete from VectorStore in Qdrant
Labels: name: lgtm, name: area: vector store, name: auto:improvement, name: size:M

**Description:**
Implement `adelete` function from `VectorStore` in `Qdrant` to support other asynchronous flows such as async indexing (`aindex`) which requires `adelete` to be implemented. Since `Qdrant` can be passed an async qdrant client, this can be supported easily.

<!-- Thank you for contributing to LangChain!

Please title your PR "<package>: <description>", where <package> is whichever of langchain, community, core, experimental, etc. is being modified.

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,
  - **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` from the root of the package you've modified to check this locally.

See contribution guidelines for more information on how to write/run tests, lint, etc: https://python.langchain.com/docs/contributing/

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.

If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17.
 -->
langchain: Add konlpy based text splitting for Korean
Labels: name: lgtm, name: needs documentation, name: area: embeddings, name: auto:improvement, name: size:L

  - **Description:** Adds a text splitter based on [Konlpy](https://konlpy.org/en/latest/#start) which is a Python package for natural language processing (NLP) of the Korean language. (It is  like Spacy or NLTK for Korean)
  - **Dependencies:** Konlpy would have to be installed before this splitter is used,
  - **Twitter handle:** @untilhamza