KEMBAR78
Extend `IntermediateStep` to support tool schemas in tool calling LLM requests by mpenn · Pull Request #357 · NVIDIA/NeMo-Agent-Toolkit · GitHub
Skip to content

Conversation

@mpenn
Copy link
Contributor

@mpenn mpenn commented Jun 10, 2025

Description

Closes #356

This PR extends the IntermediateStep data structure with additional TraceMetadata attributes that represent tool calling metadata in a tool calling LLM request. The TraceMetadata now includes a tools_schema attribute that maps to the OpenAI spec for function calling.

In addition, the LangchainProfilerHander has been extended to populate this new metadata attribute.

Finally, the AsyncOtelSpanListener has been extended to include the IntermediateStep.metadata attribute in OTel spans.

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

mpenn added 7 commits June 2, 2025 14:06
…s like tool call information

Signed-off-by: Matthew Penn <mpenn@nvidia.com>
…implement a merge function for dictionaries in AsyncOtelSpanListener. This allows for enhanced metadata handling in telemetry spans,

Signed-off-by: Matthew Penn <mpenn@nvidia.com>
…implement a merge function for dictionaries in AsyncOtelSpanListener. This allows for enhanced metadata handling in telemetry spans, ensuring non-null values are prioritized when merging metadata attributes.

Signed-off-by: Matthew Penn <mpenn@nvidia.com>
Signed-off-by: Matthew Penn <mpenn@nvidia.com>
Signed-off-by: Matthew Penn <mpenn@nvidia.com>
@mpenn mpenn self-assigned this Jun 10, 2025
@mpenn mpenn changed the title Mpenn tool call observability support Extend IntermediateStep to support tool schemas in tool calling LLM requests Jun 10, 2025
@mpenn mpenn added enhancement non-breaking Non-breaking change labels Jun 10, 2025
Signed-off-by: Matthew Penn <mpenn@nvidia.com>
@dnandakumar-nv dnandakumar-nv added improvement Improvement to existing functionality and removed enhancement labels Jun 10, 2025
@dnandakumar-nv
Copy link
Contributor

/ok to test 1776839

@mpenn mpenn removed the enhancement label Jun 10, 2025
@mpenn
Copy link
Contributor Author

mpenn commented Jun 10, 2025

/merge

@rapids-bot rapids-bot bot merged commit 67f5e9b into NVIDIA:develop Jun 10, 2025
12 checks passed
AnuradhaKaruppiah pushed a commit to AnuradhaKaruppiah/oss-agentiq that referenced this pull request Aug 4, 2025
… requests (NVIDIA#357)

Closes NVIDIA#356

This PR extends the `IntermediateStep` data structure with additional `TraceMetadata` attributes that represent tool calling metadata in a tool calling LLM request. The `TraceMetadata` now includes a `tools_schema` attribute that maps to the OpenAI spec for function calling.

In addition, the `LangchainProfilerHander` has been extended to populate this new metadata attribute.

Finally, the `AsyncOtelSpanListener` has been extended to include the `IntermediateStep.metadata` attribute in OTel spans.

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md).
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  - Any contribution which contains commits that are not Signed-Off will not be accepted.
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Matthew Penn (https://github.com/mpenn)

Approvers:
  - Dhruv Nandakumar (https://github.com/dnandakumar-nv)

URL: NVIDIA#357
scheckerNV pushed a commit to scheckerNV/aiq-factory-reset that referenced this pull request Aug 22, 2025
… requests (NVIDIA#357)

Closes NVIDIA#356

This PR extends the `IntermediateStep` data structure with additional `TraceMetadata` attributes that represent tool calling metadata in a tool calling LLM request. The `TraceMetadata` now includes a `tools_schema` attribute that maps to the OpenAI spec for function calling.

In addition, the `LangchainProfilerHander` has been extended to populate this new metadata attribute.

Finally, the `AsyncOtelSpanListener` has been extended to include the `IntermediateStep.metadata` attribute in OTel spans.

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md).
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  - Any contribution which contains commits that are not Signed-Off will not be accepted.
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Matthew Penn (https://github.com/mpenn)

Approvers:
  - Dhruv Nandakumar (https://github.com/dnandakumar-nv)

URL: NVIDIA#357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing functionality non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA]: Extend intermediate steps to support tools schemas in tool calling LLM requests

2 participants