From f705b916377e955f4a64b4f5268d6923ff329f5a Mon Sep 17 00:00:00 2001 From: Uma Annamalai Date: Wed, 9 Oct 2024 14:50:53 -0700 Subject: [PATCH 1/3] Add SQLiteVec support. --- newrelic/config.py | 6 ++++++ newrelic/hooks/mlmodel_langchain.py | 1 + 2 files changed, 7 insertions(+) diff --git a/newrelic/config.py b/newrelic/config.py index 093c178bd..7fd6f31b8 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -2511,6 +2511,12 @@ def _process_module_builtin_defaults(): "instrument_langchain_vectorstore_similarity_search", ) + _process_module_definition( + "langchain_community.vectorstores.sqlitevec", + "newrelic.hooks.mlmodel_langchain", + "instrument_langchain_vectorstore_similarity_search", + ) + _process_module_definition( "langchain_community.vectorstores.sqlitevss", "newrelic.hooks.mlmodel_langchain", diff --git a/newrelic/hooks/mlmodel_langchain.py b/newrelic/hooks/mlmodel_langchain.py index 48d281a24..7a0d7582a 100644 --- a/newrelic/hooks/mlmodel_langchain.py +++ b/newrelic/hooks/mlmodel_langchain.py @@ -100,6 +100,7 @@ "langchain_community.vectorstores.semadb": "SemaDB", "langchain_community.vectorstores.singlestoredb": "SingleStoreDB", "langchain_community.vectorstores.sklearn": "SKLearnVectorStore", + "langchain_community.vectorstores.sqlitevec": "SQLiteVec", "langchain_community.vectorstores.sqlitevss": "SQLiteVSS", "langchain_community.vectorstores.starrocks": "StarRocks", "langchain_community.vectorstores.supabase": "SupabaseVectorStore", From 9916499c93bcf72723cae076b70c143191861eec Mon Sep 17 00:00:00 2001 From: umaannamalai Date: Wed, 9 Oct 2024 21:53:21 +0000 Subject: [PATCH 2/3] [Mega-Linter] Apply linters fixes --- newrelic/hooks/mlmodel_langchain.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/newrelic/hooks/mlmodel_langchain.py b/newrelic/hooks/mlmodel_langchain.py index 7a0d7582a..c8353e74f 100644 --- a/newrelic/hooks/mlmodel_langchain.py +++ b/newrelic/hooks/mlmodel_langchain.py @@ -453,9 +453,7 @@ def _record_tool_success( try: result = str(response) except Exception: - _logger.debug( - f"Failed to convert tool response into a string.\n{traceback.format_exception(*sys.exc_info())}" - ) + _logger.debug(f"Failed to convert tool response into a string.\n{traceback.format_exception(*sys.exc_info())}") if settings.ai_monitoring.record_content.enabled: full_tool_event_dict.update( { From 6a2a66072656f7419955cdc9c1c05e18c8896779 Mon Sep 17 00:00:00 2001 From: Hannah Stepanek Date: Wed, 9 Oct 2024 15:18:01 -0700 Subject: [PATCH 3/3] Trigger tests