Invalid model when use chain
Labels: name: area: memory, name: auto:bug

### System Info

langchain: 0.0.246
python: 3.11

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

### Reproduction

I want to get a summary from chat history between ai-bot and user.
- ChatOpenAI model gpt-3.5-turbo
- LLMChain
But got an Error "openai.error.InvalidRequestError: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?"


My Code
`
    memory = get_memory_from_chat_prompt(messages)
    prompt = PromptTemplate(
        input_variables=SUMMARIZE_INPUT_VARIABLES,
        template=SUMMARIZE_CHAT_TEMPLATE
    )
    llm = ChatOpenAI(temperature=.1, model_name='gpt-3.5-turbo', max_tokens=1000)
    human_input="""Please provide a summary. You can include the key points or main findings in a concise manner."""
    answer_chain = LLMChain(llm=llm, prompt=prompt, memory=memory)
    result = answer_chain.predict(human_input=human_input)
`
Error:
`
File "/Users/congle/working/bamboo/bot/app/package/aianswer.py", line 78, in get_summarize_from_messages
    result = answer_chain.predict(human_input=human_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/llm.py", line 252, in predict
    return self(kwargs, callbacks=callbacks)[self.output_key]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/base.py", line 260, in __call__
    final_outputs: Dict[str, Any] = self.prep_outputs(
                                    ^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/base.py", line 354, in prep_outputs
    self.memory.save_context(inputs, outputs)
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/memory/summary_buffer.py", line 60, in save_context
    self.prune()
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/memory/summary_buffer.py", line 71, in prune
    self.moving_summary_buffer = self.predict_new_summary(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/memory/summary.py", line 37, in predict_new_summary
    return chain.predict(summary=existing_summary, new_lines=new_lines)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/llm.py", line 252, in predict
    return self(kwargs, callbacks=callbacks)[self.output_key]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/base.py", line 258, in __call__
    raise e
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/base.py", line 252, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/llm.py", line 92, in _call
    response = self.generate([inputs], run_manager=run_manager)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/chains/llm.py", line 102, in generate
    return self.llm.generate_prompt(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/base.py", line 451, in generate_prompt
    return self.generate(prompt_strings, stop=stop, callbacks=callbacks, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/base.py", line 582, in generate
    output = self._generate_helper(
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/base.py", line 488, in _generate_helper
    raise e
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/base.py", line 475, in _generate_helper
    self._generate(
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/openai.py", line 400, in _generate
    response = completion_with_retry(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/openai.py", line 116, in completion_with_retry
    return _completion_with_retry(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/tenacity/__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
           ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/langchain/llms/openai.py", line 114, in _completion_with_retry
    return llm.client.create(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/openai/api_resources/completion.py", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/openai/api_requestor.py", line 298, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/openai/api_requestor.py", line 700, in _interpret_response
    self._interpret_response_line(
  File "/Users/congle/.local/share/virtualenvs/bot-f4x5-mrU/lib/python3.11/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?

`

### Expected behavior

I expect to get summary from chat history by model gpt-3.5. Thanks for your help!