Skip to content

Add a RawTool : AITool type #6392

@stephentoub

Description

@stephentoub

For cases where a developer wants to use a specific tool for which there's no abstract representation, we could add a class:

public sealed class RawTool : AITool
{
    public object? RawRepresentation { get; set; }
    ...
}

Then if someone has a MyCoolAnthropicTool that's known to the underlying implementation, the developer can do:

MyCoolAnthropicTool tool = ...;
ChatOptions options = new() { Tools = [.. new RawTool(tool)] };

Leaf clients would special-case RawTool to fish out the RawRepresentation and use it directly in their processing.

We could do the same thing for other things, like response format.

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