// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Microsoft.Teams.AI.Messages; using Microsoft.Teams.AI.Prompts; namespace Microsoft.Teams.AI; /// /// a component that can change the /// way a ChatPrompt works /// [Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")] public interface IChatPlugin { /// /// called before a prompt sends /// a message /// /// the prompt /// the message /// the model options /// the transformed message public Task OnBeforeSend(IChatPrompt prompt, IMessage message, TOptions? options = default, CancellationToken cancellationToken = default); /// /// called after a prompt sends /// a message /// /// the prompt /// the message /// the model options /// the transformed message public Task OnAfterSend(IChatPrompt prompt, IMessage message, TOptions? options = default, CancellationToken cancellationToken = default); /// /// called before a prompt function is called /// /// the prompt /// the function /// the function call /// the transformed call public Task OnBeforeFunctionCall(IChatPrompt prompt, IFunction function, FunctionCall call, CancellationToken cancellationToken = default); /// /// called after a prompt function is called /// /// the prompt /// the function /// the function call /// the functions return value /// the transformed response public Task OnAfterFunctionCall(IChatPrompt prompt, IFunction function, FunctionCall call, object? output, CancellationToken cancellationToken = default); /// /// Modify the prompt functions passed to the model. /// /// the prompt /// a copy of the configured chat prompt functions /// the cancellation token /// the transformed functions public Task OnBuildFunctions(IChatPrompt prompt, FunctionCollection functions, CancellationToken cancellationToken = default); /// /// Modify the prompt instructions passed to the model. /// /// the prompt /// the instructions /// the transformed instructions public Task OnBuildInstructions(IChatPrompt prompt, DeveloperMessage? instructions, CancellationToken cancellationToken = default); }