Bugs of cookbook/openai_v1_cookbook.ipynb
Labels: name: auto:bug, name: area: models

### System Info

langchain 0.0.331
python 3.10.13
openai 1.1.1

### Who can help?

_No response_

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

### Reproduction

Run  cookbook/openai_v1_cookbook.ipynb

```
---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
[/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb) Cell 5 line 1
----> [1](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=0) chat = ChatOpenAI(model="gpt-4-vision-preview", max_tokens=256)
      [2](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=1) chat.invoke(
      [3](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=2)     [
      [4](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=3)         HumanMessage(
   (...)
     [16](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=15)     ]
     [17](vscode-notebook-cell:/Users/ianz/Work/langchain/cookbook/openai_v1_cookbook.ipynb#W4sZmlsZQ%3D%3D?line=16) )

File [~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/langchain/load/serializable.py:97](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/langchain/load/serializable.py:97), in Serializable.__init__(self, **kwargs)
     [96](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/langchain/load/serializable.py:96) def __init__(self, **kwargs: Any) -> None:
---> [97](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/langchain/load/serializable.py:97)     super().__init__(**kwargs)
     [98](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/langchain/load/serializable.py:98)     self._lc_kwargs = kwargs

File [~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/pydantic/main.py:341](https://file+.vscode-resource.vscode-cdn.net/Users/ianz/Work/langchain/cookbook/~/Work/miniconda3/envs/autoxx/lib/python3.10/site-packages/pydantic/main.py:341), in pydantic.main.BaseModel.__init__()

ValidationError: 1 validation error for ChatOpenAI
__root__
  `openai` has no `ChatCompletion` attribute, this is likely due to an old version of the openai package. Try upgrading it with `pip install --upgrade openai`. (type=value_error)
```



### Expected behavior

langchain seems to be incompatible with openai v1, I would like to know when it will be fixed