delayedkarma/langchain-issues huggingface dataset:
Getting error when including Tables in SQLDatabase.from_uri for Oracle

### System Info

LangChain 0.0.204, Windoews, Python 3.9.16, SQLAlchemy 2.0.15

db = SQLDatabase.from_uri(
    oracle_connection_str,
    include_tables=["EVR_REGION"],
    sample_rows_in_table_info=3,
)

Getting following error:
Traceback (most recent call last):
  File "Z:\MHossain_OneDrive\OneDrive\ChatGPT\LangChain\RAG\DatabaseQuery\sql_database_chain.py", line 27, in <module>
    db = SQLDatabase.from_uri(
  File "Z:\Users\User\anaconda3\envs\hugging_face_env\lib\site-packages\langchain\sql_database.py", line 124, in from_uri
    return cls(create_engine(database_uri, **_engine_args), **kwargs)
  File "Z:\Users\User\anaconda3\envs\hugging_face_env\lib\site-packages\langchain\sql_database.py", line 73, in __init__
    raise ValueError(
ValueError: include_tables {'EVR_REGION'} not found in database

If schema included like:
db = SQLDatabase.from_uri(
    oracle_connection_str,
    include_tables=["EVR1.EVR_REGION"],
    sample_rows_in_table_info=3,
)

Still getting same error.



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

### Reproduction

1. Add Tables like ->
db = SQLDatabase.from_uri(
    oracle_connection_str,
    include_tables=["EVR1.EVR_REGION"],
    sample_rows_in_table_info=3,
)
2. It is Oracle connection string
3. BTW: it is working without including table name
4. It is also working for PostgreSQL including table name

### Expected behavior

Should not get any error
SQLDatabaseSequentialChain is not submiting the SQL query with error to model to correct it. 

### System Info

LangChain 0.0.204, Windoews, Python 3.9.16, SQLAlchemy 2.0.15

My Query: list products created between 01 March 2015 and 31 March 2015 and status is 4

Results From SQLDatabaseSequentialChain:

SQLQuery:The original query is correct and does not contain any of the common mistakes listed. Therefore, the original query is:
SQLQuery:SELECT * FROM products WHERE created_date BETWEEN '2015-03-01' AND '2015-03-31' AND status = 4

sqlalchemy.exc.DatabaseError: (oracledb.exceptions.DatabaseError) ORA-00904: "CREATED_DATE": invalid identifier
[SQL: SELECT * FROM products WHERE created_date BETWEEN '2015-03-01' AND '2015-03-31' AND status = 4]

Notes: Here need to add "To_Date" function for Oracle

Question: After getting error, it is not going back to model to correct the query, right? Is there any option to tell that if you get error after executing querying, then submit the query with error to model to fix the error/ 

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

### Reproduction

1. Give a sql query which will failed to execute
2.  

### Expected behavior

Query should be fixed by model if any error occured during execution
The version 0.0.205 break the make docs_build

### System Info

version 0.0.205
The Makefile and make.bat was moved in docs/api_reference but the ./Makefile is not updated.


### Who can help?

@hwchase17 

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

git clone https://github.com/hwchase17/langchain.git
poetry install --with docs
make docs_build

### Expected behavior

Build the docs
Azure OpenAI token authenticate issue.

### System Info

Hi, I try to use my comany's token as api key for initializing AzureOpenAI, but it seems like token contains an invalid number of segments, have you encountered the same problem before?

`python
# authenticate to Azure
credentials = ClientSecretCredential(const.TENANT_ID, const.SERVICE_PRINCIPAL, const.SERVICE_PRINCIPAL_SECRET)
token = credentials.get_token(const.SCOPE_NON_INTERACTIVE)

openai.api_type = "azure_ad"
openai.api_key = token.token
openai.api_base = f"{const.OPENAI_API_BASE}/{const.OPENAI_API_TYPE}/{const.OPENAI_ACCOUNT_NAME}"
openai.api_version = const.OPENAI_API_VERSION

llm = AzureOpenAI(deployment_name=dep.GPT_35_TURBO, openai_api_version=const.OPENAI_API_VERSION, openai_api_key=openai.api_key)

llm("Tell me a joke")`
openai.error.AuthenticationError: invalid token provided: token contains an invalid number of segments

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [X] 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

credentials = ClientSecretCredential(const.TENANT_ID, const.SERVICE_PRINCIPAL, const.SERVICE_PRINCIPAL_SECRET)
token = credentials.get_token(const.SCOPE_NON_INTERACTIVE)

openai.api_type = "azure_ad"
openai.api_key = token.token
openai.api_base = f"{const.OPENAI_API_BASE}/{const.OPENAI_API_TYPE}/{const.OPENAI_ACCOUNT_NAME}"
openai.api_version = const.OPENAI_API_VERSION

llm = AzureOpenAI(deployment_name=dep.GPT_35_TURBO, openai_api_version=const.OPENAI_API_VERSION, openai_api_key=openai.api_key)

llm("Tell me a joke")

### Expected behavior

I hope llm can correctly invoke the Azure OpenAI service.
DOC: Duplicated navigation side bar of "OpenAI Functions Agent"

### Issue with current documentation:

<img width="457" alt="WeChatWorkScreenshot_18219fc9-b420-4c45-a710-ec31e27567f1" src="https://github.com/hwchase17/langchain/assets/54905519/0e524ed4-7fa4-41cf-a8d0-69399f8ac563">

@hwc

### Idea or request for content:

_No response_
feat: use latest duckduckgo_search API to call
Labels: name: lgtm

# Provider the latest duckduckgo_search API

The Git commit contents involve two files related to some DuckDuckGo query operations, and an upgrade of the DuckDuckGo module to version 3.8.3. A suitable commit message could be "Upgrade DuckDuckGo module to version 3.8.3, including query operations". Specifically, in the duckduckgo_search.py file, a DDGS() class instance is newly added to replace the previous ddg() function, and the time parameter name in the get_snippets() and results() methods is changed from "time" to "timelimit" to accommodate recent changes. In the pyproject.toml file, the duckduckgo-search module is upgraded to version 3.8.3.

[duckduckgo_search readme attention](https://github.com/deedy5/duckduckgo_search): Versions before v2.9.4 no longer work as of May 12, 2023

## Who can review?

@vowelparrot
Issue: How to consume Organization Azure OpenAI Token

### Issue with consuming Organizarion Azure OpenAI Token



Hi everyone,

Currently I used https://github.com/hwchase17/chat-your-data for training on a sample data using my personal OpenAI Token and it works properly. But to consume it for our organization we cannot use personal OpenAI Token, instead they have already set up paid subscription of Azure OpenAI Keys hosted within the organization.
The process to generate the token is to make use of a key.json file which consists of the following parameters:
```
{
"vendor": "*****",
"url": "https://azure-openai-serv-*****.com",
"uaa": {
"tenantmode": "dedicated",
"sburl": "https://*****.com",
"subaccountid": "*****",
"credential-type": "binding-secret",
"clientid": "*****|azure-openai-service-*****",
"xsappname": "******|azure-openai-service-******",
"clientsecret": "******",
"url": "https://*****.com",
"uaadomain": "*****.com",
"verificationkey": "-----BEGIN PUBLIC KEY-----\n*****\n-----END PUBLIC KEY-----",
"apiurl": "https://*****.com",
"identityzone": "*****",
"identityzoneid": "******",
"tenantid": "******",
"zoneid": "*****"
}
}
```

Now, using the following parameters, we generate the token using the steps mentioned below:

```
with open(KEY_FILE, "r") as key_file:
    svc_key = json.load(key_file)


# Get Token
svc_url = svc_key["url"]
client_id = svc_key["uaa"]["clientid"]
client_secret = svc_key["uaa"]["clientsecret"]
uaa_url = svc_key["uaa"]["url"]
params = {"grant_type": "client_credentials" }
resp = requests.post(f"{uaa_url}/oauth/token",
                     auth=(client_id, client_secret),
                     params=params)
token = resp.json()["access_token"]
```

And using this token, we use it like below:


```
data = {
    "deployment_id": "gpt-4",
    "messages": [
        {"role": "user", "content": '''Some question'''}
    ],
    "max_tokens": 800,
    "temperature": 0.7,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "top_p": 0.95,
    "stop": "null"
}
headers = {
    "Authorization":  f"Bearer {token}",
    "Content-Type": "application/json"
}
response = requests.post(f"{svc_url}/api/v1/completions",
                         headers=headers,
                         json=data)
print(response.json()['choices'][0]['message']['content'])
```

I need help regarding consuming this organization openai key in the python project https://github.com/hwchase17/chat-your-data. 

Can you please help how we can use this organizational OpenAi token instead of the personal OpenAI token. 


### Suggestion:

_No response_
DOC: details on integration tools

### Issue with current documentation:

the integration component missing what actual these extensions do.

e.g. for Banana [page](https://python.langchain.com/docs/ecosystem/integrations/bananadev)

in introduction it should be given what these tools do

referring to [doc](https://python.langchain.com/docs/ecosystem/integrations/)

### Idea or request for content:

introduction on extensions in some cases.
Unable to load image data (Image caption Loader)

### System Info

langchain-0.0.204, google colab, jupyter notebook

### Who can help?

@hwchase17 @agola11 @eyurtsev 

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

### Reproduction

![image](https://github.com/hwchase17/langchain/assets/134270260/75bccb9f-0aba-4f15-91e1-73abc2c8e56e)


Google Colab link -
https://colab.research.google.com/drive/14Qozo3LK-yyGkG1iWNk-Ubs0zXSrAc3X#scrollTo=XMbjja1o8W0x

### Expected behavior

The image data should be loaded so that we can run a query about the image  but it shows cannot get image data for the link provided, though the link works fine.
feat(document_loaders): add tencent cos directory and file loader
Labels: name: enhancement, name: area: doc loader

<!--
Thank you for contributing to LangChain! Your PR will appear in our release under the title you set. Please make sure it highlights your valuable contribution.

Replace this with a description of the change, the issue it fixes (if applicable), and relevant context. List any dependencies required for this change.

After you're done, someone will review your PR. They may suggest improvements. If no one reviews your PR within a few days, feel free to @-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd like us to shout you out on Twitter, please also include your handle!
-->

<!-- Remove if not applicable -->

- add tencent cos directory and file support for document-loader

#### Before submitting

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests, lint
etc:

https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

#### Who can review?

@eyurtsev
About the token_max variable in the "langchain\chains\combine_documents\map_reduce.py" file.

### Feature request

About the token_max variable in the "langchain\chains\combine_documents\map_reduce.py" file.
I think the value of token_max should be related to the max_token of the model, rather than setting token_max to 3000.


### Motivation

When I was using the "gpt-3.5-turbo-16k" model, I used the map_reduce chain to process a paper with 30,000 tokens，I always get ValueError
"A single document was so long it could not be combined "
"with another document, we cannot handle this."
I think these are because of the trouble caused by token_max 3000.
When I use a large token model, it is correct that token_max should also be larger.

### Your contribution

I am currently working on my problem by setting token_max to 6000, but this is not perfect, I hope to fix it to dynamically fetch token_max based on different models.
@Harrison Chase
lockfile: discussion
Labels: name: stale

### Issue you'd like to raise.

While lock file is necessary for the deployment environment, having a lock file is very hard for creating new integrations, given the fast development pace of the library.

I opened this ticket serving as a discussion on possible alternative solutions to maintaining lock file:

1. Remove it once and for all?
2. Maybe we can have a bot that helps with resolving merge conflicts for lock file specifically ?

### Suggestion:

_No response_
Update serpapi.py Support baidu list type answer_box
Labels: name: lgtm

Support baidu list type answer_box

From [this document](https://serpapi.com/baidu-answer-box), we can know that the answer_box attribute returned by the Baidu interface is a list, and the list contains only one Object, but an error will occur when the current code is executed.

So when answer_box is a list, we reset res["answer_box"] so that the code can execute successfully.
Fix latest clickhouse vector schema change 

<!--
Thank you for contributing to LangChain! Your PR will appear in our release under the title you set. Please make sure it highlights your valuable contribution.

Replace this with a description of the change, the issue it fixes (if applicable), and relevant context. List any dependencies required for this change.

After you're done, someone will review your PR. They may suggest improvements. If no one reviews your PR within a few days, feel free to @-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd like us to shout you out on Twitter, please also include your handle!
-->

Fixes https://github.com/hwchase17/langchain/issues/6208

<!-- Remove if not applicable -->

Fixes # (issue)

#### Before submitting

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests, lint
etc:

https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

#### Who can review?

Tag maintainers/contributors who might be interested:

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @hwchase17

  VectorStores / Retrievers / Memory
  - @dev2049

 -->
 
 VectorStores / Retrievers / Memory
  - @dev2049
[hotfix] Deep Lake fails on newer version due to hardcode
Labels: name: lgtm

Hot Fixes for Deep Lake [would highly appreciate expedited review]

* deeplake version was hardcoded and since deeplake upgraded the integration fails with confusing error
* an additional integration test fixed due to embedding function
* Additionally fixed docs for code understanding links after docs upgraded
* notebook removal of public parameter to make sure code understanding notebook works

#### Who can review?
  @hwchase17  @dev2049
fix neo4j schema query
Labels: name: lgtm

Fix issue #6380 

<!-- Remove if not applicable -->

Fixes #6380  (issue)

#### Before submitting

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests, lint
etc:

https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

#### Who can review?

Tag maintainers/contributors who might be interested:
@hwchase17

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @hwchase17

  VectorStores / Retrievers / Memory
  - @dev2049

 -->
Neo4J schema not inferred correctly by Neo4JGraph Object

### System Info

langchain=0.0.2

### Who can help?

@hwchase17 

### Information

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

### Related Components

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

### Reproduction

Steps to reproduce behaviors:

1. Push the following dataset to neo4J (say in neo4J browser)
```
CREATE (la:LabelA {property_a: 'a'})
CREATE (lb:LabelB {property_b1: 123, property_b2: 'b2'})
CREATE (lc:LabelC)
MERGE (la)-[:REL_TYPE]-> (lb)
MERGE (la)-[:REL_TYPE {rel_prop: 'abc'}]-> (lc)
```
2. Instantiate a Neo4JGraphObject, connect and refresh schema
```
from langchain.graphs import Neo4jGraph

graph = Neo4jGraph(
    url=NEO4J_URL,
    username=NEO4J_USERNAME,
    password=NEO4J_PASSWORD,
)

graph.refresh_schema()
print(graph.get_schema)
```
You will obtain
```
       Node properties are the following:
        [{'properties': [{'property': 'property_a', 'type': 'STRING'}], 'labels': 'LabelA'}, {'properties': [{'property': 'property_b2', 'type': 'STRING'}, {'property': 'property_b1', 'type': 'INTEGER'}], 'labels': 'LabelB'}]
        Relationship properties are the following:
        [{'type': 'REL_TYPE', 'properties': [{'property': 'rel_prop', 'type': 'STRING'}]}]
        The relationships are the following:
        ['(:LabelA)-[:REL_TYPE]->(:LabelB)']
```


### Expected behavior

```
       Node properties are the following:
        [{'properties': [{'property': 'property_a', 'type': 'STRING'}], 'labels': 'LabelA'}, {'properties': [{'property': 'property_b2', 'type': 'STRING'}, {'property': 'property_b1', 'type': 'INTEGER'}], 'labels': 'LabelB'}]
        Relationship properties are the following:
        [{'type': 'REL_TYPE', 'properties': [{'property': 'rel_prop', 'type': 'STRING'}]}]
        The relationships are the following:
        ['(:LabelA)-[:REL_TYPE]->(:LabelB)', '(:LabelA)-[:REL_TYPE]->(:LabelC)']
```
deeplake version should be = 3.6.3, but you've installed 3.6.4. Consider changing deeplake version to 3.6.3 

### System Info

Hello,
I am trying to connect to Deeplake to add documents  but am tting the error.
ValueError: deeplake version should be = 3.6.3, but you've installed 3.6.4. Consider changing deeplake version to 3.6.3 

username = "myuser"
db = DeepLake(dataset_path=f"hub://myuser/mydb", embedding_function=embeddings)
db.add_documents(texts)

I am executing this from a collab note book. Code was working fine until yesterday.
I ran this code this morning that might have updated deeplake.
!pip install --upgrade langchain deeplake

Thanks
-Milind 

### Who can help?

@eyurtsev  and @hwchase17 

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

### Reproduction

1. Update you deeplake package to 3.6.4
2. Try to create a new db in deeplake with some smaple docs

### Expected behavior

you will get the error:
ValueError: deeplake version should be = 3.6.3, but you've installed 3.6.4. Consider changing deeplake version to 3.6.3
Fixed PGVector issue when SQLAlchemy is the driver
Labels: name: area: vector store, name: auto:bug

Using SQLAlchemy as the driver for PGVector's `connection_string_from_db_params` function fails with the following error:

```
NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgresql.sqlalchemy
```

This PR removes the `+{driver}` when `sqlalchemy` is used as the driver.

Additionally, this PR also adds support for query params in the connection string via the optional `query_params` param. 

Example:

```python
CONNECTION_STRING = PGVector.connection_string_from_db_params(
    driver="sqlalchemy", 
    host="dbhost.com",
    port=5432,
    database="dbname",
    user="user",
    password="pass",
    query_params={ # ← this is new
        "sslmode": "require"
    }
)'

print(CONNECTION_STRING)

# 'postgresql://user:pass@dbhost.com:5432/dbname?sslmode=require', 
```

Tested on Postgres 14, 15, and Supabase

@dev2049 ☝️
Support for Rate Limits with Concurrent Workers

### Feature request

I am proposing an enhancement to the Langchain project that will allow the handling of concurrent requests for task workers. This proposal aims to introduce a mechanism similar to the API request parallel processor used in the OpenAI Cookbook.

The implementation should ideally manage several task workers, assigning and executing requests in parallel. This should improve task processing speed and efficiency, especially when dealing with a large number of tasks. You can check the relevant details and example code from [this link](https://github.com/openai/openai-cookbook/blob/main/examples/api_request_parallel_processor.py).

### Motivation

I'm currently using langchain for a project that has a few processes that is very reliant on using Langchain, it is a process that takes hours if done serially, so I rewrote it to be done in parallel but with that I'm hitting rate limits very quickly with Langchain.

### Your contribution

N/A