Skip to content

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Oct 9, 2025

We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.

Microsoft Reviewers: Open in CodeFlow

@stephentoub stephentoub requested a review from a team as a code owner October 9, 2025 17:09
Copilot AI review requested due to automatic review settings October 9, 2025 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the OpenTelemetry integration for chat clients to emit telemetry data for all types of AI tools, not just function declarations. Previously, the system only captured telemetry for AIFunctionDeclaration tools, but now it handles function wrappers and emits tool names as types for other tool varieties.

Key changes:

  • Enhanced tool telemetry logic to support all tool types through pattern matching
  • Added Name property implementations to hosted tool classes for proper identification
  • Updated test coverage to validate telemetry output for various tool types

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
OpenTelemetryChatClient.cs Updated telemetry logic to handle all tool types with pattern matching and made Parameters nullable
HostedWebSearchTool.cs Added Name property override returning "web_search"
HostedFileSearchTool.cs Added Name property override returning "file_search"
HostedCodeInterpreterTool.cs Added Name property override returning "code_interpreter"
HostedMcpServerTool.cs Added Name property override returning "mcp"
OpenTelemetryChatClientTests.cs Added test cases for new tool types and their expected telemetry output
Microsoft.Extensions.AI.Abstractions.json Updated API baseline manifest with new Name property definitions

@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Oct 9, 2025
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
@stephentoub stephentoub merged commit ffee6c7 into dotnet:main Oct 10, 2025
6 checks passed
joperezr pushed a commit to joperezr/extensions that referenced this pull request Oct 14, 2025
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull request Oct 21, 2025
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull request Oct 21, 2025
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants