// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Json.Schema; namespace Microsoft.Teams.AI.Prompts; public partial class ChatPrompt { /// /// provide another chat prompt to be used /// as a function /// /// the chat prompt public ChatPrompt Chain(IChatPrompt prompt) { Functions.Add(new Function( prompt.Name, prompt.Description, new JsonSchemaBuilder().Properties( ("text", new JsonSchemaBuilder().Type(SchemaValueType.String).Description("text to send")) ), async (string text) => { var res = await prompt.Send(text).ConfigureAwait(false); return res.Content; } )); return this; } }