The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Fix latest message index (#13355)
billytrend-cohere2f6fe6ddf380
diff --git a/libs/langchain/langchain/chat_models/cohere.py b/libs/langchain/langchain/chat_models/cohere.pyindex 4b09e06aff..632997c98b 100644--- a/libs/langchain/langchain/chat_models/cohere.py+++ b/libs/langchain/langchain/chat_models/cohere.py@@ -80,9 +80,9 @@ def get_cohere_chat_request()return {- "message": messages[0].content,+ "message": messages[-1].content,"chat_history": [- {"role": get_role(x), "message": x.content} for x in messages[1:]+ {"role": get_role(x), "message": x.content} for x in messages[:-1]],"documents": documents,"connectors": maybe_connectors,