MicrosoftExtensionsAIResponsesExtensions.Add Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the ResponseTool to the list of AITools.
public:
[System::Runtime::CompilerServices::Extension]
static void Add(System::Collections::Generic::IList<Microsoft::Extensions::AI::AITool ^> ^ tools, OpenAI::Responses::ResponseTool ^ tool);
public static void Add(this System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool> tools, OpenAI.Responses.ResponseTool tool);
static member Add : System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool> * OpenAI.Responses.ResponseTool -> unit
<Extension()>
Public Sub Add (tools As IList(Of AITool), tool As ResponseTool)
Parameters
- tool
- ResponseTool
The ResponseTool to add.
Remarks
ResponseTool does not derive from AITool, so it cannot be added directly to a list of AITools. Instead, this method wraps the provided ResponseTool in an AITool and adds that to the list. The IChatClient returned by AsIChatClient(OpenAIResponseClient) will be able to unwrap the ResponseTool when it processes the list of tools and use the provided tool as-is.