Skip to content

Commit

Permalink
Merge pull request #1231 from newrelic/add-langchain-vs
Browse files Browse the repository at this point in the history
Instrument SQLiteVec vectorstore in LangChain
  • Loading branch information
umaannamalai authored Oct 9, 2024
2 parents 3a001b0 + 6a2a660 commit 2d17237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions newrelic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions newrelic/hooks/mlmodel_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -452,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(
{
Expand Down

0 comments on commit 2d17237

Please sign in to comment.