Skip to content

Suppress FunctionInvoking span when no tools are defined #6744

@verdie-g

Description

@verdie-g

We use a common chat builder for all our applications that creates a FunctionInvokingChatClient. Many of these applications don't use tools but still get a FunctionInvokingChatClient.GetResponseAsync.

// A single request into this GetResponseAsync may result in multiple requests to the inner client.
// Create an activity to group them together for better observability.
using Activity? activity = _activitySource?.StartActivity($"{nameof(FunctionInvokingChatClient)}.{nameof(GetResponseAsync)}");

Image

Would it make sense to suppress that span if options.Tools and AdditionalTools are empty?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-aiMicrosoft.Extensions.AI libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions