Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(llmobs): submit langchain similarity search spans #9971

Merged
merged 64 commits into from
Aug 27, 2024

Conversation

yahya-mouman
Copy link
Contributor

@yahya-mouman yahya-mouman commented Jul 29, 2024

This PR adds instrumentation to submit langchain vector similarity search spans to LLM Observability. The similarity search spans sent to LLM Observability will contain the following I/O data:

input.value: a text field annotating the search query
output.value: The output document objects for the vector similarity search

Ticket : https://datadoghq.atlassian.net/browse/MLOB-938

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Jul 29, 2024

CODEOWNERS have been resolved as:

releasenotes/notes/feat-llmobs-submit-langchain-similarity-search-spans-c5581deda8b6878e.yaml  @DataDog/apm-python
tests/contrib/langchain/cassettes/langchain_community/openai_pinecone_similarity_search_community.yaml  @DataDog/ml-observability
ddtrace/contrib/internal/langchain/patch.py                             @DataDog/ml-observability
ddtrace/llmobs/_integrations/langchain.py                               @DataDog/ml-observability
tests/contrib/langchain/conftest.py                                     @DataDog/ml-observability
tests/contrib/langchain/test_langchain_llmobs.py                        @DataDog/ml-observability
tests/llmobs/_utils.py                                                  @DataDog/ml-observability

@pr-commenter
Copy link

pr-commenter bot commented Jul 29, 2024

Benchmarks

Benchmark execution time: 2024-08-27 17:59:40

Comparing candidate commit 600a8e1 in PR branch yahya/add-langchain-similarity-search-support with baseline commit 9a114a2 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 353 metrics, 47 unstable metrics.

@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: yahya/add-langchain-similarity-search-support
Commit report: e78c7fd
Test service: dd-trace-py

✅ 0 Failed, 3219 Passed, 37666 Skipped, 39m 28.81s Total Time

ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
@yahya-mouman yahya-mouman marked this pull request as ready for review August 22, 2024 15:47
@yahya-mouman yahya-mouman requested review from a team as code owners August 22, 2024 15:47
Copy link
Contributor

@Yun-Kim Yun-Kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit but otherwise lgtm. Thanks!

ddtrace/llmobs/_integrations/langchain.py Outdated Show resolved Hide resolved
@Yun-Kim Yun-Kim merged commit 300a1d4 into main Aug 27, 2024
233 of 234 checks passed
@Yun-Kim Yun-Kim deleted the yahya/add-langchain-similarity-search-support branch August 27, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants