delayedkarma/langchain-issues huggingface dataset:
changed broken link for wandb tracing with agent
Labels: name: lgtm, name: auto:documentation, name: size:XS

fix of #14905 

<!-- 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.
 -->
Issue: Pypdf extract_image=True is not working on docker(production)
Labels: name: area: doc loader, name: auto:bug

### Issue you'd like to raise.

Hello Team,

we are trying to use pypdf to get the text out from the pdf use the chunk for embedding(details are there in attached code snippet. while using, i have installed all the required packages. its working fine in my local(windows 10). same code snippet and requirement.txt if i use on docker that uses ubuntu OS(its in prod), i am getting below error:

**Error while chunking the file: Error while chunking the file, Errored while loading the document: `rapidocr-onnxruntime` package not found, please install it with `pip install rapidocr-onnxruntime**`


The strage part here is this **rapidocr-onnxruntime** package is already installed on the ubuntu system**(i re-verified by seeing the github action runner logs where it installs all the packages from requirement.txt)**

Not able to understand why on prod it **pypdf package with extract_image=True** is throwing above error

It will be helpful, if you can provide any insight or workaround to this issue.
![process_pdff](https://github.com/langchain-ai/langchain/assets/34799343/d7a33465-d59d-438b-b6e2-3e68ab82fc9b)


### Suggestion:

_No response_
community: Update pgvecto_rs to use its high level sdk
Labels: name: area: vector store, name: auto:improvement, 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.
 -->

  - **Description:** Update pgvecto_rs to use its high level sdk, 
  - **Issue:** fix #15173
Issue: Not able to get the expected answers when asking answer of other column corresponding to other column
Labels: name: area: doc loader, name: auto:question

### Issue you'd like to raise.

`        if file_path.lower().endswith(".xlsx") or file_path.lower().endswith(".xls"):
            loader = UnstructuredExcelLoader(file_path, mode="elements")
            document = loader.load()
            text_splitter = RecursiveCharacterTextSplitter(chunk_size=100, chunk_overlap=10)
            texts = text_splitter.split_documents(documents=document)`
            what can i modify so that I get answer from the column?

### Suggestion:

_No response_
How to set api key for news-api?
Labels: name: auto:bug

### System Info

I want to use the news-api tool, and I have these setting for api key: 
```
os.environ["NEWS_API_KEY"] = "9ed***"

tools = load_tools(["news-api"], llm=llm, news_api_key="9ed****", memory=memory)
```

But when the action is activated, the error is:

```
Action: Search

https://newsapi.org/v2/top-headlines?country=us&category=sports&pageSize=2&apiKey=YOUR_API_KEY


Replace `YOUR_API_KEY` with your actual API key from NewsAPI.org to authenticate the request.
```

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [X] 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

1. load news-api tool
2. run the tool in the agent

### Expected behavior

the news-api tool can run successfully
community:Adding Konko Completion endpoint 
Labels: name: auto:enhancement, name: area: models, name: size:XL

This PR introduces update to Konko Integration with LangChain.

1. **New Endpoint Addition**: Integration of a new endpoint to utilize completion models hosted on Konko. 

2. **Chat Model Updates for Backward Compatibility**: We have updated the chat models to ensure backward compatibility with previous OpenAI versions. 

4. **Updated Documentation**: Comprehensive documentation has been updated to reflect these new changes, providing clear guidance on utilizing the new features and ensuring seamless integration.

Thank you to the LangChain team for their exceptional work and for considering this PR. Please let me know if any additional information is needed.
Adding reading source for Curie model
Labels: name: lgtm, name: auto:documentation, name: area: models, name: size:XS

Improving documentation

<!-- 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:** Adding resource for Curie model
  - **Issue:** the issue # it fixes if applicable,
  - **Dependencies:** any dependencies required for this change,
  - **Twitter handle:** @mmarccode

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.
 -->
Issue: How to use "n" completions with LCEL
Labels: name: auto:improvement, name: area: lcel

### Issue you'd like to raise.

I'm using Langchain 0.0.354 and ChatOpenAI. I want to use parameter "n" in OpenAI API to return "n" completions. However, ChatOpenAI always returns a single output. Ultimately, I would like to build my chain using LCEL as follows: `chain = prompt | ChatOpenAI (n=10) | MyCustomParser`. Can someone help me how can I achieve this?

### Suggestion:

I think it would be nice to return a list of strings by default if n > 1.
Authentican error
Labels: name: auto:bug, name: area: models

### Issue you'd like to raise.

I am trying to run the below:

> import requests
> import json
> from langchain.agents import AgentType, initialize_agent, load_tools
> from langchain_community.llms import OpenAI
> from langchain.chat_models import ChatOpenAI
> 
> 
> llm = ChatOpenAI(temperature=0,model= 'gpt-3.5-turbo', openai_api_key="...")
> 
> token='...'
> tools = load_tools(
>     ["graphql"],
>     custom_headers={"Authorization": token, "Content-Type": "application/json","API-Version" : "2024-01"},
>     graphql_endpoint="https://api.monday.com/v2",
>     llm=llm, fetch_schema_from_transport=False
> )
> 
> 
> agent = initialize_agent(
>     tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True
> )
> 
> 
> 
> graphql_fields = """
> 
> mutation{
>   create_item (board_id: 3573920662, item_name: "New ItemX"){
>     id
>     name
>   }
> }
> 
> """
> 
> suffix = "Create the item specified"
> 
> 
> print(suffix + graphql_fields)
> 
> agent.run(suffix + graphql_fields)

But I keep getting the error:

> 
> TransportQueryError: Error while fetching schema: Not Authenticated
> If you don't need the schema, you can try with: "fetch_schema_from_transport=False"

The authorisation is correct (token and API key censored here) and so is the end point. How can I fix this?


### Suggestion:

_No response_
How to specify a custom schema in PGVector.from_documents?
Labels: name: area: vector store, name: auto:question

### Issue you'd like to raise.

```
from langchain.vectorstores.pgvector import PGVector

db = PGVector.from_documents(
    documents= docs,
    embedding = embeddings,
    collection_name= "blog_posts",
    distance_strategy = DistanceStrategy.COSINE,
    connection_string=CONNECTION_STRING
)
```
This code will create a table in public schema. How to specify a custom schema other than public?

### Suggestion:

_No response_
Question: Using TimeWeightedVectorStoreRetriever and GenerativeAgentMemory is there a way to save the memory and load it again?
Labels: name: area: memory, name: auto:question, name: integration: pinecone

### Issue you'd like to raise.

I have a large Agent with lots of memory/observations but initializing takes to much time. Is there a way to save the memory and load it again? Whats the best way to achieve this? Ideally I would like to reuse the vector store for memory and then for each new user save/load the memory/conversations specific to that agent/user connection.

I'm using the examples in the cookbook here: https://github.com/langchain-ai/langchain/blob/master/cookbook/generative_agents_interactive_simulacra_of_human_behavior.ipynb

### Suggestion:

_No response_
WARNING:pypdf._reader:incorrect startxref pointer(3)
Labels: name: area: doc loader, name: auto:bug

### System Info

I try to load pdf in from langchain.document_loaders import PyPDFDirectoryLoader
got error this WARNING:pypdf._reader:incorrect startxref pointer(3)

from langchain.document_loaders import PyPDFDirectoryLoader
from langchain_community.document_loaders import PyPDFLoader

loader = PyPDFDirectoryLoader("/content/pdfs/Carina Lueschen Masterarbeit Ryan Trecartin (1).pdf")
pages = loader.load_and_split()

will return blank array and warning error

### Who can help?

@hwchase17 @agola11 @sbusso 

### Information

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

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

### Reproduction

just load the pdf which having images

### Expected behavior

output should be in array of pdf data
Fix: stop (stop_sequences) param on WatsonxLLM
Labels: name: auto:bug, name: area: models, name: size:S

  - **Description:** Fix to IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) LLM provider (stop (`stop_sequences`) param on watsonxLLM)
  - **Dependencies:** [ibm-watsonx-ai](https://pypi.org/project/ibm-watsonx-ai/),
  - **Tag maintainer:** : @hwchase17 , @eyurtsev , @baskaryan 

Please make sure your PR is passing linting and testing before submitting. Run `make format`, `make lint` and `make test` to check this locally. ✅
INFORMATION_SCHEMA.VECTOR_INDEXES was not found in google big-query
Labels: name: area: vector store, name: auto:bug

### System Info

google-cloud-bigquery = "^3.14.1"
google-api-core = "^2.15.0"
google-cloud-core = "^2.4.1"
grpcio = "^1.60.0"
grpcio-tools = "^1.60.0"
langchain-google-genai = "^0.0.5"
langchain-core = "^0.1.5"
google-cloud-aiplatform = "^1.38.1"
langchain-community = "^0.0.8"

### Who can help?

when test the BigQuery Vector Search as website demo,https://python.langchain.com/docs/integrations/vectorstores/bigquery_vector_search
it caused Not found: Table xxx.xxx.INFORMATION_SCHEMA.VECTOR_INDEXES was not found in location US. in google big-query 

### 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
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

the procedures steps are in the page of https://python.langchain.com/docs/integrations/vectorstores/bigquery_vector_search
,official langchain demo page.

### Expected behavior

it was official langchain demo page. and result should be shown but error.
probably something went wrong with big-query, please help, thanks a lot!
feat: limit the number of concurrent requests in the RecursiveUrlLoader
Labels: name: area: doc loader, name: auto:improvement

### Feature request

When using asynchronous loading the `RecursiveUrlLoader`, it would be nice to be able to set a limit for the number of parallel HTTP requests when scraping a website. 

Right now, when using async loading it is very likely to get errors like the following:
```
04-01-24 12:02:53 [WARNING] recursive_url_loader.py: Unable to load https://docs.llamaindex.ai/en/stable/module_guides/querying/querying.html. 
Received error Cannot connect to host docs.llamaindex.ai:443 ssl:default [Network is unreachable] of type ClientConnectorError
```

### Motivation

This feature allows to:
- Reduce the probability of receiving an error due to the excessive number of requests.
- Make the loader more robust.

### Your contribution

I have already implemented and tested a solution using `asyncio.Semaphore`. This class allows to set a limit for the maximum number of parallel tasks that can be performed in a program.
<langchain>: tracing_enabled incompatibility issue between core 0.1.5 and langchain v0.0.353
Labels: name: auto:bug, name: size:XS

https://github.com/langchain-ai/langchain/issues/15526

TLDR:

In commit [7eec8f2](https://github.com/langchain-ai/langchain/commit/7eec8f24876fd624573c09ff82270362031e6a5f#) the function [tracing_enabled](https://github.com/langchain-ai/langchain/commit/7eec8f24876fd624573c09ff82270362031e6a5f#diff-aa3d4ef71b404ecd0d1198ccf778a3ccc605d9b6e043057d0db3bd8f7d9c483dL46) was deleted.

the function deletion was included in langchain-core [0.1.5](https://github.com/langchain-ai/langchain/pull/15480), and is being referred to by v0.0.353, which didn't clean up the dependencies yet, not until v0.0.354

Causing the retrievers API of v0.0.353 and some earlier versions to raise ImportError after Jan 3rd, when langchain-core 0.1.5 was released.
removed deprecated openai model 
Labels: name: lgtm, name: area: embeddings, name: auto:documentation, name: size:XS

removed the deprecated model from text embedding page of openai notebook and added the suggested model from openai page 


<!-- 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.
 -->
ArgillaCallback doesn't properly set DEFAULT_API_KEY
Labels: name: auto:bug

### System Info

Python version: 3.9.7
Langchain version: 0.0.352
Argilla version: 1.20.0

### Who can help?

@agola11 

### 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
- [X] Callbacks/Tracing
- [ ] Async

### Reproduction

ArgillaCallbackHandler does not set the DEFAULT_API_KEY properly while initiliazing. This might cause problems with some setups. Link to line: https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/callbacks/argilla_callback.py#L137

### Expected behavior

DEFAULT_API_KEY to be correctly set.
The ChatHuggingFace package cannot be found. "from langchain_community.chat_models.huggingface import ChatHuggingFace"，Has ChatHuggingFace changed paths？
Labels: name: auto:question, name: area: models

### System Info

langchain                 0.0.351
langchain-community       0.0.4
python 3.9

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

### Reproduction

from langchain_community.chat_models.huggingface import ChatHuggingFace

### Expected behavior

I was testing HuggingFace Chat Wrapper, but couldn't import the ChatHuggingFace。Has ChatHuggingFace changed paths？
community: Correct Input API Key Name in Notebook and Enhance Readability of Comments for ZhipuAI Chat Model
Labels: name: lgtm, name: auto:documentation, name: area: models, name: size:XL

- **Description:** This update rectifies an error in the notebook by changing the input variable from `zhipu_api_key` to `api_key`. It also includes revisions to comments to improve program readability.
- **Issue:** The input variable in the notebook example should be `api_key` instead of `zhipu_api_key`.
- **Dependencies:** No additional dependencies are required for this change.

To ensure quality and standards, we have performed extensive linting and testing. Commands such as make format, make lint, and make test have been run from the root of the modified package to ensure compliance with LangChain's coding standards.
Issue: <How can I extract vector data from pgvector for use as a reference in the next conversation to enable long-term memory functionality for my chatbot?>
Labels: name: area: embeddings, name: integration: supabase

### Issue you'd like to raise.

from langchain.chains import LLMChain
from langchain.prompts import (
    ChatPromptTemplate,
    HumanMessagePromptTemplate,
    MessagesPlaceholder,
    SystemMessagePromptTemplate,
)
import psycopg2
import os
from langchain.chat_models import ChatOpenAI
from langchain.memory import ConversationBufferMemory
from sentence_transformers import SentenceTransformer

os.environ['OPENAI_API_KEY'] = "key"
database = "MemoryChatBot"
user = "xxxxxxx"
password = "xxx"
host = "1x2.xxx.0x.xx"
port = "5432"
conn = psycopg2.connect(database=database, user=user, password=password, host=host, port=port)
print("ok!")
llm = ChatOpenAI(
    temperature=0.7,
    model="gpt-3.5-turbo",
    max_tokens=100
)
prompt = ChatPromptTemplate(
    messages=[
        SystemMessagePromptTemplate.from_template(
            "you are robot."
        ),
        MessagesPlaceholder(variable_name="chat_history"),
        HumanMessagePromptTemplate.from_template("{question}"),
    ]
)
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
conversation = LLMChain(llm=llm, prompt=prompt, verbose=False, memory=memory)
all_history = []
while True:
    chat_history = memory.load_memory_variables({})
    question = input('user：')
    result = conversation.run({'question': question, 'chat_history': chat_history})
    memory.save_context({question: question}, {result: result})
    talk_all = conversation.memory.buffer
    all_history.append(talk_all)
    print(result)
    if question.lower() == 'bye':
        st_history = ' '.join(map(str, all_history))
        model = SentenceTransformer('flax-sentence-embeddings/all_datasets_v3_MiniLM-L12') #384emb
        # model = SentenceTransformer('BAAI/bge-large-zh-v1.5') #1024emb
        res = model.encode(st_history)
        model.query_instruction = "test"
        res_str = str(res.tolist())
        cursor = conn.cursor()
        sql = f"INSERT INTO tmp04 (embedding) VALUES ('{res_str}')"
        cursor.execute(sql)
        conn.commit()
        print(f'embedding:  {res[:4].tolist()}...')
        print("ok!")
        break


![未命名](https://github.com/langchain-ai/langchain/assets/103471919/9ed7efcf-649f-4fda-8097-b524662e32a5)


### Suggestion:

Hope for more support packages for pgvector.
ImportError: cannot import name 'tracing_enabled' from 'langchain_core.tracers.context' (/usr/local/lib/python3.11/site-packages/langchain_core/tracers/context.py
Labels: name: auto:bug

### System Info

0.0.352 and 0.0.353

### 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
- [ ] Tools / Toolkits
- [ ] Chains
- [X] Callbacks/Tracing
- [ ] Async

### Reproduction

Custom _call wrapper

### Expected behavior

No import error