langchain
bc21045e - fix(ollama): prevent `_convert_messages_to_ollama_messages` from mutating caller list (#36567)

Commit
44 days ago
fix(ollama): prevent `_convert_messages_to_ollama_messages` from mutating caller list (#36567) Fixes #36564 The method modifies messages[idx] in-place when converting v1 format content. Add messages = list(messages) to create a shallow copy before any mutations. 1 line change in libs/partners/ollama/langchain_ollama/chat_models.py Co-authored-by: bahtya <bahtyar153@qq.com> Co-authored-by: Mason Daugherty <mason@langchain.dev>
Author
Parents
Loading