InvalidRequestError: This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
Labels: name: auto:bug, name: auto:question, name: area: models

### System Info

For this code:
from langchain import LLMMathChain, OpenAI, SerpAPIWrapper, SQLDatabase
from langchain_experimental.sql import SQLDatabaseChain
from langchain.agents import initialize_agent, Tool
from langchain.agents import AgentType
from langchain.chat_models import ChatOpenAI
from decouple import config

oak = openai_secret_key (witheld for sake of security)
openai_api_key = oak

llm = ChatOpenAI(temperature=0, model="babbage-002", openai_api_key=openai_api_key)

llm_math_chain = LLMMathChain.from_llm(llm=llm, verbose=True)

db = SQLDatabase.from_uri("sqlite:///maids.db")

db_chain = SQLDatabaseChain.from_llm(llm, db, verbose=True)

tools = [
    Tool(
        name="Yellowsense_Database",
        func=db_chain.run,
        description="useful for when you need to answer questions about maids/cooks/nannies."
    )
]


agent = initialize_agent(
    tools=tools, llm=llm, agent=AgentType.OPENAI_FUNCTIONS, verbose=True)

user_input = input(
        """You can now chat with your database.
        Please enter your question or type 'quit' to exit: """
    )

agent.run(user_input)                                                                                                                                             I am getting this error: 
InvalidRequestError: This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?                                                                                                                                           
What all models can I use for chatmodel?

### Who can help?

_No response_

### 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

This is the code I am using: from langchain import LLMMathChain, OpenAI, SerpAPIWrapper, SQLDatabase
from langchain_experimental.sql import SQLDatabaseChain
from langchain.agents import initialize_agent, Tool
from langchain.agents import AgentType
from langchain.chat_models import ChatOpenAI
from decouple import config

a = "sk-wLQRwTr8RS"
b = "Z1ph7bIlovT3B"
c = "lbkFJe49s56n"
d = "KfeWgts8MpMQC"
oak = a + b + c + d
openai_api_key = oak
# create LLM model
llm = ChatOpenAI(temperature=0, model="babbage-002", openai_api_key=openai_api_key)
# create an LLM math tool
llm_math_chain = LLMMathChain.from_llm(llm=llm, verbose=True)
# connect to our database
db = SQLDatabase.from_uri("sqlite:///maids.db")
# create the database chain
db_chain = SQLDatabaseChain.from_llm(llm, db, verbose=True)

tools = [
    Tool(
        name="Maid_Database",
        func=db_chain.run,
        description="useful for when you need to answer questions about maids/cooks/nannies."
    )
]

# creating the agent
agent = initialize_agent(
    tools=tools, llm=llm, agent=AgentType.OPENAI_FUNCTIONS, verbose=True)

user_input = input(
        """You can now chat with your database.
        Please enter your question or type 'quit' to exit: """
    )
# ask the LLM a question
agent.run(user_input)                                        

### Expected behavior

I should be getting the answer using the model I selected