// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Microsoft.Teams.AI.Messages; namespace Microsoft.Teams.AI.Models; /// /// a model that can reason over and /// respond with text /// [Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")] public interface IChatModel : IModel { /// /// send a message to the model /// /// the message to send /// the options /// the models response public Task> Send(IMessage message, ChatModelOptions options, CancellationToken cancellationToken = default); /// /// send a message to the model and stream /// the response /// /// the message to send /// the options /// the stream to use /// the models response public Task> Send(IMessage message, ChatModelOptions options, IStream stream, CancellationToken cancellationToken = default); } /// /// options to send with the message /// [Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")] public class ChatModelOptions { /// /// the initial prompt message that defines /// model behavior /// public DeveloperMessage? Prompt { get; set; } /// /// the conversation history /// public IList Messages { get; set; } = []; /// /// the registered functions that can be /// called /// public required IList Functions { get; set; } /// /// the request options defined by the model /// public TOptions? Options { get; set; } /// /// the handler used to invoke functions /// internal Func>? OnInvoke; public ChatModelOptions(Func>? onInvoke = null) { OnInvoke = onInvoke; } /// /// invoke a function /// /// the function call /// the function response public Task Invoke(FunctionCall call, CancellationToken cancellationToken = default) { return OnInvoke is null ? Task.FromResult(null) : OnInvoke(call, cancellationToken); } }