The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Avoid IntegrityError for SQLiteCache updates (#1286)
Alexander Hoyle42b892c21be7
diff --git a/langchain/cache.py b/langchain/cache.pyindex bdf444fea4..3d7149d91f 100644--- a/langchain/cache.py+++ b/langchain/cache.py@@ -87,7 +87,7 @@ class SQLAlchemyCache(BaseCache):prompt=prompt, llm=llm_string, response=generation.text, idx=i)with Session(self.engine) as session, session.begin():- session.add(item)+ session.merge(item)class SQLiteCache(SQLAlchemyCache):