Skip to content

The agent engineering platform.

Update in_memory.py to fix "TypeError: keywords must be strings" (#7202)

Paul Cook7cd0936b1ca3
diff --git a/langchain/docstore/in_memory.py b/langchain/docstore/in_memory.py
index f1e3610258..1049337839 100644
--- a/langchain/docstore/in_memory.py
+++ b/langchain/docstore/in_memory.py
@@ -17,7 +17,7 @@ class InMemoryDocstore(Docstore, AddableMixin):
overlapping = set(texts).intersection(self._dict)
if overlapping:
raise ValueError(f"Tried to add ids that already exist: {overlapping}")
- self._dict = dict(self._dict, **texts)
+ self._dict = {**self._dict, **texts}
def search(self, search: str) -> Union[str, Document]:
"""Search via direct lookup."""