delayedkarma/langchain-issues huggingface dataset:
Please modify ChatOllama to allow the option to specify main_gpu
Labels: name: auto:improvement, name: area: models

### Feature request

When there are multiple GPUs available, the Ollama API provides the main_gpu option to specify which GPU to use as the main one. Please modify Langchain's ChatOllama to also include this feature.

![image](https://github.com/langchain-ai/langchain/assets/42790398/2c085dbf-0fe8-496f-b6d5-490d3a6b7571)


### Motivation

When running multiple tasks simultaneously on a server, it is necessary to designate specific processes for Ollama.

### Your contribution

None
<langchain_community.vectorstores>:<Fix pinecone.py __init__ docsrting instruction>
Labels: name: lgtm, name: area: vector store, name: auto:documentation, name: integration: pinecone, name: size:XS

  - **Description:** The pinecone docstring instructs to pass the embedding query text causing the warning below. It should be the embeddings object.
 warning message: UserWarning: Passing in `embedding` as a Callable is deprecated. Please pass in an Embeddings object instead.
  - **Issue:** NA
  - **Dependencies:** None


@baskaryan
DOC: stop params does not work with langchain_community.llms import VLLM but work in LLMChain
Labels: name: auto:bug, name: area: models

### Issue with current documentation:

With langchain version == 0.1.0
This stop param of the Class VLLM does not work.
For instance, this code has no effect regarding stop word.
```
model = VLLM(
    stop=["stop_word"],
    model=model_name,
    trust_remote_code=True,  # mandatory for hf models
    max_new_tokens=512,
    top_k=10,
    top_p=0.95,
    temperature=0.2,
    vllm_kwargs=vllm_kwargs,
)
```

But this code works: 

```
prompt = PromptTemplate(
    template=template, input_variables=["system_message", "question"]
)
llm_chain = LLMChain(prompt=prompt, llm=model)

llm_chain.run(
  {"system_message": system_message, "question": question, "stop":["stop_word"]}
)
```

### Idea or request for content:

Clear the documentation or it is a bug.
Issues with SelfQueryRetriever and the "AND" operator failing in queries that search for multiple metadata flags
Labels: name: area: vector store, name: auto:bug, name: integration: chroma

### 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

```python
metadata_field_info = [
        AttributeInfo(name="source",description="The document this chunk is from.",type="string"),
        AttributeInfo(name="origin",description="The origin the document came from. Comes from either scraped websites like TheKinection.org, Kinecta.org or database files like Bancworks. Bancworks is the higher priority.",type="string"),
        AttributeInfo(name="date_day",description="The day the document was uploaded.",type="string"),
        AttributeInfo(name="date_uploaded",description="The month year the document is current to.",type="string"),
        AttributeInfo(name="date_month",description="The month the document was uploaded.",type="string"),
        AttributeInfo(name="date_month_name",description="The month name the document was uploaded.",type="string"),
        AttributeInfo(name="date_year_long",description="The full year the document was uploaded.",type="string"),
        AttributeInfo(name="date_year_short",description="The short year the document was uploaded.",type="string"),
    ]

llm = ChatOpenAI(temperature=0)
vectorstore = Pinecone.from_existing_index(index_name="test", embedding=get_embedding_function())
# print("Load existing vector store")\

retriever = SelfQueryRetriever.from_llm(
    llm,
    vectorstore,
    "Information about when the document was created and where it was grabbed from.",
    metadata_field_info,
)
```

```python
question = "Give the minimum opening deposits for each accounts for the rate sheets in January"
retriever.get_relevant_documents(question)
```

### Description

When I ask to fetch relevant documents with the following query: 

- "Give the minimum opening deposits for each accounts for the rate sheets in January"

There is no problem. However, if I make this query a little more robust...

-  "Give the minimum opening deposits for each accounts for the rate sheets in January 2023"

I get a CNAME "and" error. This happens in both Pinecone and ChromaDB. Something is wrong with how the query translator is operating or I am missing some crucial step. We should be able to use multiple metadata flags at once.

### System Info

Python 3.11
Langchain 0.1.0
Chroma 0.4.22
Pinecone 2.2.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
- [ ] Callbacks/Tracing
- [ ] Async
Pass config specs through ensemble retriever
Labels: name: area: embeddings, name: auto:improvement, name: integration: elasticsearch, name: size:L

<!-- 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: fix OutputParserException (#15914)
Labels: name: lgtm, name: auto:bug, name: area: models, name: size:XS

**Description:**

Fixes OutputParserException thrown by the output_parser when 'query' is 'Null'.

Replace this entire comment with:
  - **Description:** Current implentation of output_parser throws OutputParserException if the response from the LLM contains `query: null`. This unfortunately happens for my use case. And since there is no way to modify the prompt used in SelfQueryRetriever, then we have to fix it here, so it doesn't crash. 
  - **Issue:** https://github.com/langchain-ai/langchain/issues/15914

Didn't run tests. `make test` is not working. There is no `test` rule in the `Makefile`.
Passthrough configurable primitive values as tracer metadata
Labels: name: lgtm, name: auto:improvement, name: size:M

<!-- 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.
 -->
infra: retry release if not found on test pypi
Labels: name: auto:improvement, name: size:S

<!-- 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.
 -->
community: SQLStrStore/SQLDocStore provide an easy SQL alternative to `InMemoryStore` to persist data remotely in a SQL storage
Labels: name: area: memory, name: lgtm, name: auto:enhancement, name: size:XL

**Description:**

- Implement `SQLStrStore` and `SQLDocStore` classes that inherits from `BaseStore` to allow to persist data remotely on a SQL server.
- SQL is widely used and sometimes we do not want to install a caching solution like Redis.
- Multiple issues/comments complain that there is no easy remote and persistent solution that are not in memory (users want to replace InMemoryStore), e.g., https://github.com/langchain-ai/langchain/issues/14267, https://github.com/langchain-ai/langchain/issues/15633, https://github.com/langchain-ai/langchain/issues/14643, https://stackoverflow.com/questions/77385587/persist-parentdocumentretriever-of-langchain
- This is particularly painful when wanting to use `ParentDocumentRetriever `
- This implementation is particularly useful when:
     * it's expensive to construct an InMemoryDocstore/dict
     * you want to retrieve documents from remote sources
     * you just want to reuse existing objects
- This implementation integrates well with PGVector, indeed, when using PGVector, you already have a SQL instance running. `SQLDocStore` is a convenient way of using this instance to store documents associated to vectors. An integration example with ParentDocumentRetriever and PGVector is provided in docs/docs/integrations/stores/sql.ipynb or [here](https://github.com/gcheron/langchain/blob/sql-store/docs/docs/integrations/stores/sql.ipynb).
- It persists `str` and `Document` objects but can be easily extended.

 **Issue:**

Provide an easy SQL alternative to `InMemoryStore`.
feat: add additional support for `BigQueryVectorSearch`
Labels: name: lgtm, name: area: vector store, name: auto:improvement, name: size:M

BigQuery vector search lets you use GoogleSQL to do semantic search, using vector indexes for fast but approximate results, or using brute force for exact results.

This PR:
1. Add `metadata[_job_ib]` in Document returned by any similarity search
2. Add `explore_job_stats` to enable users to explore job statistics and better the debuggability
3. Set the minimum row limit for running create vector index.
<!-- 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,
  4. 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.
 -->
core: New Technique for Unique Chunk Retrivals
Labels: name: area: vector store, name: auto:enhancement, name: size:M

**Description:** 
Please find the attached pdf, where everything is detailed described :D
[langchain_core.pdf](https://github.com/langchain-ai/langchain/files/13905129/langchain_core.pdf)
  
**Dependencies:**
In order to solve Generalized assignment problem, we need to add 'mip' solver.

**Twitter handle:** no need ;)
 

If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17.
[docs] Integration Documentation updated run to invoke for llms/ai21.ipynb 
Labels: name: lgtm, name: auto:documentation, name: area: models, name: size:M


  - **Description:** Updated Integration Documentation for [llms/ai21.ipynb](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/llms/ai21.ipynb)
  - **Issue:** #15664,
  - **Dependencies:** NA,
  - **Twitter handle:** @BhadreshSavani
The sample code of version 0.1.0 of the official website cannot be executed.
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

from langchain_openai import ChatOpenAI

llm = ChatOpenAI()

llm.invoke("how can langsmith help with testing?")

### Description

site-packages\langchain_openai\chat_models\base.py", line 454, in _create_chat_result
    response = response.dict()
AttributeError: 'str' object has no attribute 'dict'

### System Info

Python 3.10.12
langchain 0.1.0

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [X] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async
argument needs to be of type (SquadExample, dict)
Labels: name: area: vector store

### 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

```python
model_name = "Intel/dynamic_tinybert"

tokenizer = AutoTokenizer.from_pretrained(model_name, padding=True, truncation=True, max_length=512)

question_answerer = pipeline(
    "question-answering",
    model=model_name,
    tokenizer=tokenizer,
    return_tensors='pt'
)


llm = HuggingFacePipeline(
    pipeline=question_answerer,
    model_kwargs={"temperature": 0.7, "max_length": 50},
)


prompt_template = """
As literature critic answer me

question: {question}

context: {context}
"""

prompt = PromptTemplate(template=prompt_template, input_variables=["context", "question"])


chain = RetrievalQA.from_chain_type(
    llm=llm,
    chain_type="stuff",
    retriever=retriever,
    chain_type_kwargs = {"prompt": prompt})

question = "Who is Hamlet ?"
answer = chain.invoke({"query": question})  # issue here <--
print(answer)
```

### Description

I tried to implement simple RetrievalQA from with langchain_chain.faiss vector search but I've faced with such assert, 
 argument needs to be of type (SquadExample, dict)
 
Here, there is an issue.
 answer = chain.invoke({"query": question})

Thank you in advance.

 

### System Info

Windows 10, python 3.11, langchain    0.1.0

### 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
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async
community: Ollama - Pass headers to post request
Labels: name: lgtm, name: auto:improvement, name: area: models, name: size:M

## Feature
- Set additional headers in constructor
- Headers will be sent in post request

This feature is useful if deploying Ollama on a cloud service such as hugging face, which requires authentication tokens to be passed in the request header.

## Tests
- Test if header is passed
- Test if header is not passed
feat(community): make Amadeus toolkit LLM-agnostic
Labels: name: auto:improvement, name: area: models, name: size:S

 - **Description:** `AmadeusToolkit` and `AmadeusClosestAirport` contained a hardcoded call to `ChatOpenAI`. This PR makes it LLM-independent, while guaranteeing backward compatibility.
  - **Issue:** #15847 
  - **Dependencies:** None
   
@baskaryan 

<!-- 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.
 -->
Resource not found error trying to use chromadb with Azure Open AI
Labels: name: area: vector store, name: auto:bug, name: integration: chroma

### 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

import os
import openai
import sys

import panel as pn  # GUI
pn.extension()

from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv()) # read local .env file

import datetime
current_date = datetime.datetime.now().date()
if current_date < datetime.date(2023, 9, 2):
    llm_name = "gpt-3.5-turbo-0301"
else:
    llm_name = "gpt-3.5-turbo"
print(llm_name)

from langchain.vectorstores import Chroma
from langchain.embeddings.openai import OpenAIEmbeddings

from langchain.document_loaders import PyPDFLoader

docs = PyPDFLoader("sameer_mahajan.pdf").load()

from langchain.text_splitter import TokenTextSplitter

text_splitter = TokenTextSplitter(chunk_size=1, chunk_overlap=0)
splits = text_splitter.split_documents(docs)

embedding = OpenAIEmbeddings(
        deployment = "embeddings",
        openai_api_key = os.environ['OPENAI_API_KEY'],
        openai_api_base = os.environ['OPENAI_ENDPOINT'],
        openai_api_version = os.environ['OPENAI_DEPLOYMENT_VERSION'],
        openai_api_type = "azure",
        chunk_size = 1)

vectordb = Chroma.from_documents(
    documents=splits,
    embedding=embedding,
    persist_directory=persist_directory
)


### Description

I expect vectordb to persist for my further chatbot however I get an exception of 

`NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}`

### System Info

python 3.10.2
embedding model text-embedding-ada-002

### Related Components

- [ ] LLMs/Chat Models
- [X] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async
langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: Deadline of 60.0s exceeded while calling target function
Labels: name: area: embeddings, name: auto:bug, name: integration: pinecone

### 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_google_genai import GoogleGenerativeAIEmbeddings

embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
vector = embeddings.embed_query("hello, world!")

### Description

langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: Deadline of 60.0s exceeded while calling target function

### System Info

langchain                                0.1.0
langchain-community                      0.0.10
langchain-core                           0.1.8
langchain-google-genai                   0.0.5
langchain-openai                         0.0.2
langchainhub                             0.1.14


### 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
- [ ] Callbacks/Tracing
- [ ] Async