delayedkarma/langchain-issues huggingface dataset:
GraphQAChain not working when using Networkx graphs !!
Labels: name: auto:bug, name: area: models

### System Info

Langchain==0.0.352
MacOS intel version
python==3.8.3
networkx==2.7.1

### Who can help?

@hwchase17 @agola11 I have an issue when initializing GraphQAChain using networkx graph.

### Information

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

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

### Reproduction

I made a networkx graph and tried to initialize GraphQAChain but got the below error.

<img width="1010" alt="image" src="https://github.com/langchain-ai/langchain/assets/41593805/d4ba54bc-bf43-4303-8550-8ef75fb4b7e0">

<img width="1482" alt="image" src="https://github.com/langchain-ai/langchain/assets/41593805/c4286425-7df7-4c3a-bbc5-3e6e92a69786">


### Expected behavior

I would like to initialize GraphQAChain and chat with the network. 
Please help!
NVIDIA Triton+TRT-LLM connector needs to handle dynamic model parameters
Labels: name: auto:bug, name: area: models, name: NVIDIA

### System Info

LangChain 0.0.348
langchain-nvidia-trt 0.0.1rc0
Python 3.11

### Who can help?

@jdye64 

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### 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

### Reproduction

You can set up the triton server as in the quick start guide here using a nemotron model:

https://github.com/fciannella/langchain-fciannella/blob/master/libs/partners/nvidia-trt/README.md

Then you can just try sending a request from the LangChain plugin and it will not work. 

Same thing if you follow the more complex setup.

The input and output parameters need to be discovered by the client. One option is to use pytriton as a client, or just pull the parameters from the server using an API call to get the triton configuration?

### Expected behavior

The client should provide a list of the mandatory parameters in the error code in case there is a missing parameter in the request.
BUG! The arguments of function calling returned by gpt 3.5 might not be a dict
Labels: name: area: agent, name: auto:bug

https://github.com/langchain-ai/langchain/blob/2460f977c5c20073b41803c41fd08945be34cd60/libs/langchain/langchain/agents/output_parsers/openai_functions.py#L49

Eeven though you pass your customized function, gpt-3.5 will often return a function call which name is "python" and the arguments are not in json format.

I would suggest to check the function name here. (Idea from Open Interpreter Source Code)

Thanks,

ZD
Issue: ValueError: Could not parse output:
Labels: name: auto:bug, name: area: models

### Issue you'd like to raise.

Seeing an issue in my code that appeared out of nowhere, hoping for some support here. The error message I am seeing is `ValueError: Could not parse output:  Answer to inquiry from OpenAI. Score: 90` from the output_parsers/regex.py (https://github.com/langchain-ai/langchain/blob/v0.0.257/libs/langchain/langchain/output_parsers/regex.py#L35) 

Langchain version: v0.0.257
LLM OpenAI: https://github.com/langchain-ai/langchain/blob/v0.0.257/libs/langchain/langchain/llms/openai.py
Model: text-davinci-003
Chain type: map_rerank (https://github.com/langchain-ai/langchain/blob/v0.0.257/libs/langchain/langchain/chains/combine_documents/map_rerank.py)
Vector store: Qdrant

Code to reproduce:
```python
import os
from pathlib import Path
from langchain import OpenAI, PromptTemplate
from langchain.chains import RetrievalQAWithSourcesChain
from langchain.memory import FileChatMessageHistory
import logging
from service import db
logging.basicConfig(level=logging.DEBUG)

def conversation(question):
    collection_name = "qdrant_collection_name"
    llm = OpenAI(model='text-davinci-003', openai_api_key=os.environ['OPENAI_API_KEY'], temperature=0.0)

    combine_prompt_template = """
    'DOCUMENTS:
    {summaries}

    QUESTION:
    {question}

    ### Response:
    """

    COMBINE_PROMPT = PromptTemplate(
        template=combine_prompt_template, input_variables=["summaries", "question"]
    )

    qa_chain = RetrievalQAWithSourcesChain.from_chain_type(
        llm,
        chain_type='map_rerank',
        retriever=db.vectorstore(collection_name).as_retriever(),
        return_source_documents=True,
        reduce_k_below_max_tokens=True,
    )

    return qa_chain({"question": question})['answer']

if __name__ == "__main__":
    print(conversation('How do I add sales tax to a transaction in avatax?'))
```

Also posting on Stackoverflow

### Suggestion:

N/A
infra: CI python matrix update 3.12
Labels: name: auto:improvement, name: size:L

Adds python 3.12 to our testing matrix

Also:
- only runs scheduled tests with python 3.8 and 3.12 (not all versions)

Current work:
- duckdb not compatible - need fix or workaround: https://github.com/duckdb/duckdb/issues/9301
Add option to make messages placeholder optional
Labels: name: lgtm, name: auto:improvement, name: area: models, 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: Adds ability to pass a Config to the boto3 client used by Bedrock
Labels: name: lgtm, name: auto:improvement, name: area: models, name: integration: aws, name: size:S

# Description  
This PR adds the ability to pass a `botocore.config.Config` instance to the boto3 client instantiated by the Bedrock LLM.

Currently, the Bedrock LLM doesn't support a way to pass a Config, which means that some settings (e.g., timeouts and retry configuration) require instantiating a new boto3 client with a Config and then replacing the LLM's client:

```python
llm = Bedrock(
        region_name='us-west-2',
        model_id="anthropic.claude-v2",
        model_kwargs={'max_tokens_to_sample': 4096, 'temperature': 0},
)

llm.client = boto_client('bedrock-runtime', region_name='us-west-2', config=Config({'read_timeout': 300}))
```

# Issue
N/A

# Dependencies
N/A
CI: update poetry 1.6.1 -> 1.7.1
Labels: name: lgtm, name: auto:improvement, name: size:S

CI: Update poetry version 1.6.1 -> 1.7.1 to bring many fixes and python 3.12 support
Changelog: [1.7.0](https://github.com/python-poetry/poetry/releases/tag/1.7.0), [1.7.1](https://github.com/python-poetry/poetry/releases/tag/1.7.1)
Move json and xml parsers to core
Labels: name: lgtm, name: auto:refactor, name: area: models, name: size:XXL

<!-- 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.
 -->
Ollama integration: The stop sequence is empty when do inference
Labels: name: auto:bug, name: area: models

## Describe the problem

When do inference (with the llm or chat model) we pass a empty list to POST request, when the "stop" attribute of `_create_stream` is not set.
This create a problem when using model, bc ollama override the stop sequence list of the model with the list we pass in the request

## Solution
I tried in local, and by deleting this [line](https://github.com/langchain-ai/langchain/blob/1b01ee0e3c7f0df5855c7440d471ddab4f0efc7e/libs/community/langchain_community/llms/ollama.py#L162C1-L162C1) , the stop list will be set by ollama  when we don't have either a "global stop" (the one we define in the costructor of the ollama or chatollama class) or a stop sequence from the calling of the function.
Also ollama know support a new endpoint to retrive information about the model (using GET /api/show), but need parsing so Maybe it's a idea for the future...

Yes, i know
"if you are working with one model, just put the stop sequences and ez" but i think is very bad...
docs: updated the right path for integrations page
Labels: name: area: doc loader, name: auto:documentation, name: size:XS

<!-- Thank you for contributing to LangChain!

If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17.
 -->

- **Description:** Updated the right path for Integrations Page to resolve 404 Not Found issue on the website, 
  - **Issue:** #14998 ,
  - **Dependencies:** No dependencies required,
  - **Twitter handle:** [@vardhaman722](https://twitter.com/vardhaman722)
It's possible agent Langchain return a Pandas Dataframe?
Labels: name: area: agent, name: auto:enhancement

### Feature request

I am developing an application using Langchain with the following code

```
from langchain.agents.agent_types import AgentType
from langchain.chat_models import ChatOpenAI
from langchain_experimental.agents.agent_toolkits import create_pandas_dataframe_agent

import pandas as pd
from langchain.llms import OpenAI

df = pd.read_csv("titanic.csv")

agent = create_pandas_dataframe_agent(OpenAI(temperature=0), df, verbose=True)

agent.run("how many rows are there?")

```

I would like to know if the agent can return a DataFrame instead of the response as text. For example, if I ask it to add a column, it would return a DataFrame as a response with the added column.

### Motivation

A new feature would help in automation.

### Your contribution

What can I do to help with the project, count me in!
community: refactor Baseten integration with new API endpoints & docs
Labels: name: lgtm, name: auto:refactor, name: area: models, name: size:L

  - **Description:** In response to user feedback, this PR refactors the Baseten integration with updated model endpoints, as well as updates relevant documentation. This PR has been tested by end users in production and works as expected.
  - **Issue:** N/A
  - **Dependencies:** This PR actually removes the dependency on the `baseten` package! 
  - **Twitter handle:** https://twitter.com/basetenco
AttributeError while executing VectorstoreIndexCreator & DocArrayInMemorySearch
Labels: name: area: vector store, name: auto:bug

### System Info

I am using below packages.
Python 3.12.1
langchain 0.0.352
pydantic 2.5.2
openai 1.4.0
huggingface-hub 0.19.4

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

While executing the below code from deeplearning.ai

from langchain.chains import RetrievalQA
from langchain.chat_models import ChatOpenAI
from langchain.document_loaders import CSVLoader
from langchain.vectorstores import DocArrayInMemorySearch
from IPython.display import display, Markdown

file = 'OutdoorClothingCatalog_1000.csv'
loader = CSVLoader(file_path=file, encoding='utf8')

from langchain.indexes import VectorstoreIndexCreator

index = VectorstoreIndexCreator(
    vectorstore_cls=DocArrayInMemorySearch
).from_loaders([loader])


### Expected behavior

Code should successfully execute
Update youtube_transcript.ipynb
Labels: name: lgtm, name: area: doc loader, name: auto:documentation, name: size:XS

add_video_info should be false in the first example

<!-- 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: not getting output as per my prompt template
Labels: name: auto:bug, name: area: models

### Issue you'd like to raise.

# below is my code  
`def generate_custom_prompt(query):   
    # Create the custom prompt template
    custom_prompt_template = f"""You are a chatbot designed to provide helpful answers to user questions. If you encounter a question for which you don't know the answer, please respond with 'I don't know' and refrain from making up an answer.
    User's Question: {query}    
    In your response, aim for clarity and conciseness. Provide information that directly addresses the user's query. If the answer requires additional details, feel free to ask clarifying questions.
    Remember, your goal is to assist the user in the best way possible. If the question is unclear or ambiguous, you can ask for clarification.

    Your Helpful Answer:"""

    # Create the PromptTemplate
    custom_prompt = PromptTemplate(
        template=custom_prompt_template, input_variables=["query"]
    )

    # Format the prompt
    formatted_prompt = custom_prompt.format(query=query)

    return formatted_prompt`
    #below is the error i am getting
        response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/hs/CustomBot/chatbot/views.py", line 360, in GetChatResponse
    custom_message=generate_custom_prompt(query)
  File "/home/hs/CustomBot/accounts/common_langcain_qa.py", line 40, in generate_custom_prompt
    formatted_prompt = custom_prompt.format(query=query)
  File "/home/hs/env/lib/python3.8/site-packages/langchain_core/prompts/prompt.py", line 132, in format
    return DEFAULT_FORMATTER_MAPPING[self.template_format](self.template, **kwargs)
  File "/usr/lib/python3.8/string.py", line 163, in format
    return self.vformat(format_string, args, kwargs)
  File "/home/hs/env/lib/python3.8/site-packages/langchain_core/utils/formatting.py", line 29, in vformat
    return super().vformat(format_string, args, kwargs)
  File "/usr/lib/python3.8/string.py", line 168, in vformat
    self.check_unused_args(used_args, args, kwargs)
  File "/home/hs/env/lib/python3.8/site-packages/langchain_core/utils/formatting.py", line 18, in check_unused_args
    raise KeyError(extra)
KeyError: {'query'}

### Suggestion:

_No response_
TEMPLATES: Update README.md
Labels: name: area: doc loader, name: auto:documentation, name: size:XS

Mulitple -> Multiple

<!-- 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.
 -->
Error message when adhering to Agents Langchain documentation only substituting OpenAI with AzureOpenAI: "openai.NotFoundError: Error code: 404 - {'error': {'message': 'Unrecognized request argument supplied: functions', 'type': 'invalid_request_error', 'param': None, 'code': None}}"
Labels: name: area: agent, name: auto:bug

### Issue you'd like to raise.

I am following the documentation on https://python.langchain.com/docs/modules/agents/, but as I only have access to an Azure deployment of OpenAI, there is a small deviance from the tutorial. When running the code:

`from langchain.chat_models import AzureChatOpenAI
from langchain.agents import tool
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser

import os
os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_VERSION"] = "2023-07-01-preview"

# Define the AzureChatOpenAI model
llm = AzureChatOpenAI(
    azure_endpoint="https://ENDPOINT.openai.azure.com",
    deployment_name="NAME",
    api_key="KEY",
    temperature=0.5
)

### Create tool
from langchain.agents import tool

@tool
def get_word_length(word: str) -> int:
    """Returns the length of a word."""
    return len(word)

tools = [get_word_length]

### create prompt
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder

prompt = ChatPromptTemplate.from_messages(
    [
        (
            "system",
            "You are very powerful assistant, but bad at calculating lengths of words.",
        ),
        ("user", "{input}"),
        MessagesPlaceholder(variable_name="agent_scratchpad"),
    ]
)

### llm with tool
from langchain.tools.render import format_tool_to_openai_function

llm_with_tools = llm.bind(functions=[format_tool_to_openai_function(t) for t in tools])

#### create agent
from langchain.agents.format_scratchpad import format_to_openai_function_messages
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser

agent = (
    {
        "input": lambda x: x["input"],
        "agent_scratchpad": lambda x: format_to_openai_function_messages(
            x["intermediate_steps"]
        ),
    }
    | prompt
    | llm_with_tools
    | OpenAIFunctionsAgentOutputParser()
)

agent.invoke({"input": "how many letters in the word educa?", "intermediate_steps": []})`

I get the following error message, which arises from agent.invoke(...):

openai.NotFoundError: Error code: 404 - {'error': {'message': 'Unrecognized request argument supplied: functions', 'type': 'invalid_request_error', 'param': None, 'code': None}}

### Suggestion:

_No response_
In Pypdf loader "/n " is not removed before creating documents
Labels: name: area: doc loader, name: auto:bug

### System Info

Everything is latest

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

### Reproduction

from langchain.document_loaders import PyPDFLoader

loader = PyPDFLoader("path/to/document")
pages = loader.load_and_split()

### Expected behavior

Documents should not have "/n"
ValueError: not enough values to unpack (expected 2, got 1)
Labels: name: area: embeddings, name: auto:bug

### Issue you'd like to raise.

Traceback (most recent call last):
  File "c:\Users\vivek\OneDrive\Desktop\SOPPOC\version.py", line 57, in <module>
    openAIEmbedd = FAISS.from_documents(texts, embeddings)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_core\vectorstores.py", line 510, in from_documents
    return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_community\vectorstores\faiss.py", line 914, in from_texts
    embeddings = embedding.embed_documents(texts)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_community\embeddings\openai.py", line 667, in embed_documents
    return self._get_len_safe_embeddings(texts, engine=engine)
 
        ^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
why i am getting this error

### Suggestion:

_No response_