The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
fix(ollama): prevent `_convert_messages_to_ollama_messages` from mutating caller list (#36567)
bahtyarbc21045ee054
diff --git a/libs/partners/ollama/langchain_ollama/chat_models.py b/libs/partners/ollama/langchain_ollama/chat_models.pyindex ffe8766b80..4892e350f2 100644--- a/libs/partners/ollama/langchain_ollama/chat_models.py+++ b/libs/partners/ollama/langchain_ollama/chat_models.py@@ -865,6 +865,7 @@ class ChatOllama(BaseChatModel):Returns:List of messages in Ollama format."""+ messages = list(messages) # shallow copy to avoid mutating caller's listfor idx, message in enumerate(messages):# Handle message content written in v1 formatif (