Skip to content

langchain_cohere: cannot import name 'ChatResponse' from 'cohere.types' #681

@gotsysdba

Description

@gotsysdba

SDK Version (required)

5.16.0 and 5.16.1

Describe the bug
For completeness, starting with 5.16 the langchain_cohere module breaks (langchain-ai/langchain-cohere#140)

Full stack from langchain-cohere==0.4.4

Traceback (most recent call last):
    from langchain_cohere import ChatCohere, CohereEmbeddings
  File ".venv/lib/python3.11/site-packages/langchain_cohere/__init__.py", line 1, in <module>
    from langchain_cohere.chains.summarize.summarize_chain import load_summarize_chain
  File ".venv/lib/python3.11/site-packages/langchain_cohere/chains/summarize/summarize_chain.py", line 19, in <module>
    from langchain_cohere.chat_models import ChatCohere
  File ".venv/lib/python3.11/site-packages/langchain_cohere/chat_models.py", line 19, in <module>
    from cohere.types import (
ImportError: cannot import name 'ChatResponse' from 'cohere.types' (.venv/lib/python3.11/site-packages/cohere/types/__init__.py)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions