fix(langchain): Use gen_ai.tool.definitions attribute when data collection is enabled - #7204
Open
ericapisani wants to merge 1 commit into
Open
fix(langchain): Use gen_ai.tool.definitions attribute when data collection is enabled#7204ericapisani wants to merge 1 commit into
gen_ai.tool.definitions attribute when data collection is enabled#7204ericapisani wants to merge 1 commit into
Conversation
…lection is enabled When `data_collection` is configured, tool definitions should be set on `GEN_AI_TOOL_DEFINITIONS` instead of the legacy `GEN_AI_REQUEST_AVAILABLE_TOOLS` attribute, matching the updated gen-ai semantic conventions. The legacy attribute is still used when `data_collection` is not configured. Also gate the response tool calls recorded in `on_llm_end` on the `outputs` setting rather than `inputs`, since they are part of the model's response. Refs PY-2734 Refs #7200
Contributor
Codecov Results 📊✅ 113283 passed | ⏭️ 6769 skipped | Total: 120052 | Pass Rate: 94.36% | Execution Time: 411m 16s 📊 Comparison with Base Branch
➖ Removed Tests (1)View removed tests
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2493 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 90.20% 90.19% -0.01%
==========================================
Files 193 193 —
Lines 25423 25422 -1
Branches 9336 9336 —
==========================================
+ Hits 22933 22929 -4
- Misses 2490 2493 +3
- Partials 1436 1441 +5Generated by Codecov Action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
data_collectionis configured, tool definitions should be set onGEN_AI_TOOL_DEFINITIONSinstead of the legacyGEN_AI_REQUEST_AVAILABLE_TOOLSattribute, matching the updated gen-ai semantic conventions. The legacy attribute is still used whendata_collectionis not configured.Also gate the response tool calls recorded in
on_llm_endon theoutputssetting rather thaninputs, since they are part of the model's response.Refs PY-2734
Refs #7200