Skip to content

Commit 2d17237

Browse files
authored
Merge pull request #1231 from newrelic/add-langchain-vs
Instrument SQLiteVec vectorstore in LangChain
2 parents 3a001b0 + 6a2a660 commit 2d17237

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

newrelic/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,12 @@ def _process_module_builtin_defaults():
25112511
"instrument_langchain_vectorstore_similarity_search",
25122512
)
25132513

2514+
_process_module_definition(
2515+
"langchain_community.vectorstores.sqlitevec",
2516+
"newrelic.hooks.mlmodel_langchain",
2517+
"instrument_langchain_vectorstore_similarity_search",
2518+
)
2519+
25142520
_process_module_definition(
25152521
"langchain_community.vectorstores.sqlitevss",
25162522
"newrelic.hooks.mlmodel_langchain",

newrelic/hooks/mlmodel_langchain.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"langchain_community.vectorstores.semadb": "SemaDB",
101101
"langchain_community.vectorstores.singlestoredb": "SingleStoreDB",
102102
"langchain_community.vectorstores.sklearn": "SKLearnVectorStore",
103+
"langchain_community.vectorstores.sqlitevec": "SQLiteVec",
103104
"langchain_community.vectorstores.sqlitevss": "SQLiteVSS",
104105
"langchain_community.vectorstores.starrocks": "StarRocks",
105106
"langchain_community.vectorstores.supabase": "SupabaseVectorStore",
@@ -452,9 +453,7 @@ def _record_tool_success(
452453
try:
453454
result = str(response)
454455
except Exception:
455-
_logger.debug(
456-
f"Failed to convert tool response into a string.\n{traceback.format_exception(*sys.exc_info())}"
457-
)
456+
_logger.debug(f"Failed to convert tool response into a string.\n{traceback.format_exception(*sys.exc_info())}")
458457
if settings.ai_monitoring.record_content.enabled:
459458
full_tool_event_dict.update(
460459
{

0 commit comments

Comments
 (0)