SQLDatabaseToolkit - httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol
Labels: name: area: agent, name: auto:bug

### System Info

Python 3.11
Langchain 0.0.354
Windows 11
 


### 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
- [X] Agents / Agent Executors
- [X] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Getting exception httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol. while executing SQLDatabaseToolkit

Execute below code and described environment: 
`import os
from dotenv import load_dotenv
from langchain.agents import  create_sql_agent
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain.sql_database import SQLDatabase
from langchain.chat_models import ChatOpenAI


llm_model = "gpt-3.5-turbo"


#load secrets and keys from .env
load_dotenv()
database_user_local = os.getenv("DATABASE_USERNAME_LOCAL")
database_password_local = os.getenv("DATABASE_PASSWORD_LOCAL")
database_server_local = os.getenv("DATABASE_SERVER_LOCAL")
database_db_local = os.getenv("DATABASE_DB_LOCAL")

llm = ChatOpenAI(temperature = 0.0, model_name=llm_model)

connection_string = f"mssql+pymssql://{database_user_local}:{database_password_local}@{database_server_local}/{database_db_local}"


db = SQLDatabase.from_uri(connection_string)


user_id = 118

query = "Select top 5 * from dbo.Users where Id = " + str(user_id)

toolkit = SQLDatabaseToolkit(db=db, llm=llm, reduce_k_below_max_tokens=True)
agent_executor = create_sql_agent(
    llm=llm,
    toolkit=toolkit,
    verbose=True,
    input_variables=["query"]
)


agent_executor.run("Get lastlogin from dbo.Users for user_id 118")

`


Error: 
` Entering new AgentExecutor chain...
Traceback (most recent call last):
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 67, in map_httpcore_exceptions
    yield
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpcore\_sync\connection_pool.py", line 215, in handle_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Program\Python\Python311\Lib\site-packages\openai\_base_client.py", line 866, in _request
    response = self._client.send(request, auth=self.custom_auth, stream=stream)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 915, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 943, in _send_handling_auth       
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 980, in _send_handling_redirects  
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 1016, in _send_single_request     
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 230, in handle_request
    with map_httpcore_exceptions():
  File "D:\Program\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 84, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 67, in map_httpcore_exceptions
    yield
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpcore\_sync\connection_pool.py", line 215, in handle_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Program\Python\Python311\Lib\site-packages\openai\_base_client.py", line 866, in _request
    response = self._client.send(request, auth=self.custom_auth, stream=stream)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 915, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 943, in _send_handling_auth       
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 980, in _send_handling_redirects  
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_client.py", line 1016, in _send_single_request     
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 230, in handle_request
    with map_httpcore_exceptions():
  File "D:\Program\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "D:\Program\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 84, in map_httpcore_exceptions`





### Expected behavior

It should execute sql agent and return the result