diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 949c432..11c5d7d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -24,6 +24,11 @@ updates: Extensions: patterns: - "Microsoft.Extensions*" + exclude-patterns: + - "Microsoft.Extensions.AI*" + ExtensionsAI: + patterns: + - "Microsoft.Extensions.AI*" Web: patterns: - "Microsoft.AspNetCore*" diff --git a/.netconfig b/.netconfig index 3472e4f..5549f4e 100644 --- a/.netconfig +++ b/.netconfig @@ -29,9 +29,9 @@ weak [file ".github/dependabot.yml"] url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml - sha = 917ff5486e25bec90038e7ab6d146fd82c61f846 + sha = e733294084fb3e75d517a2e961e87df8faae7dc6 - etag = 50bf50df5a6eeb1705baea50f4c6e06d167a89cb5a590887ff939bd4120bd442 + etag = 3bf8d9214a15c049ca5cfe80d212a8cbe4753b8a638a9804ef73d34c7def9618 weak [file ".github/release.yml"] url = https://github.com/devlooped/oss/blob/main/.github/release.yml diff --git a/readme.md b/readme.md index 471d68b..9d4b602 100644 --- a/readme.md +++ b/readme.md @@ -222,7 +222,6 @@ developer's account or through your GitHub organization. [![Kori Francis](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/kfrancis.png "Kori Francis")](https://github.com/kfrancis) [![Toni Wenzel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/twenzel.png "Toni Wenzel")](https://github.com/twenzel) [![Uno Platform](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/unoplatform.png "Uno Platform")](https://github.com/unoplatform) -[![Dan Siegel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/dansiegel.png "Dan Siegel")](https://github.com/dansiegel) [![Reuben Swartz](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/rbnswartz.png "Reuben Swartz")](https://github.com/rbnswartz) [![Jacob Foshee](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jfoshee.png "Jacob Foshee")](https://github.com/jfoshee) [![](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Mrxx99.png "")](https://github.com/Mrxx99) @@ -241,7 +240,6 @@ developer's account or through your GitHub organization. [![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo) [![Jordan S. Jones](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jordansjones.png "Jordan S. Jones")](https://github.com/jordansjones) [![domischell](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/DominicSchell.png "domischell")](https://github.com/DominicSchell) -[![Mauricio Scheffer](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mausch.png "Mauricio Scheffer")](https://github.com/mausch) [![Justin Wendlandt](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jwendl.png "Justin Wendlandt")](https://github.com/jwendl) [![Adrian Alonso](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/adalon.png "Adrian Alonso")](https://github.com/adalon) [![Michael Hagedorn](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Eule02.png "Michael Hagedorn")](https://github.com/Eule02) diff --git a/src/SampleApp/Sample/Program.cs b/src/SampleApp/Sample/Program.cs index 5502dcd..e253832 100644 --- a/src/SampleApp/Sample/Program.cs +++ b/src/SampleApp/Sample/Program.cs @@ -95,7 +95,7 @@ static async IAsyncEnumerable ProcessMessagesAsync( // simulate some hard work at hand, like doing some LLM-stuff :) //await Task.Delay(2000); - yield return content.TextWithButtons( + yield return content.Text( $"☑️ Got your {content.Content.Type}:\r\n{JsonSerializer.Serialize(content, options)}", new Button("btn_good", "👍"), new Button("btn_bad", "👎")); diff --git a/src/WhatsApp/MessageExtensions.cs b/src/WhatsApp/MessageExtensions.cs index 9cf2a69..f1b9b1e 100644 --- a/src/WhatsApp/MessageExtensions.cs +++ b/src/WhatsApp/MessageExtensions.cs @@ -11,25 +11,25 @@ public static partial class MessageExtensions /// Creates a reaction response for the user message. /// public static ReactionResponse React(this UserMessage message, string emoji) - => new ReactionResponse(message.From.Number, message.To.Id, message.Id, message.ConversationId, emoji); + => new(message.From.Number, message.To.Id, message.Id, message.ConversationId, emoji); /// /// Creates a reengagement response for the error message. /// public static TemplateResponse Reengage(this ErrorMessage message) - => new TemplateResponse(message.From.Number, message.To.Id, message.Id, message.ConversationId, "reengagement", "es_AR"); + => new(message.From.Number, message.To.Id, message.Id, message.ConversationId, "reengagement", "es_AR"); /// /// Creates a text response for the message. /// public static TextResponse Text(this Message message, string text) - => new TextResponse(message.From.Number, message.To.Id, message.Id, message.ConversationId, text); + => new(message.From.Number, message.To.Id, message.Id, message.ConversationId, text); /// /// Creates a text response with buttons for the message. /// - public static TextResponse TextWithButtons(this Message message, string text, Button button1, Button? button2 = default) - => new TextResponse(message.From.Number, message.To.Id, message.Id, message.ConversationId, text, button1, button2); + public static TextResponse Text(this Message message, string text, Button button1, Button? button2 = default) + => new(message.From.Number, message.To.Id, message.Id, message.ConversationId, text, button1, button2); /// /// Attempts to retrieve a single message from the specified collection. @@ -42,7 +42,7 @@ public static TextResponse TextWithButtons(this Message message, string text, Bu /// When this method returns , contains the single message from the collection. When this /// method returns , contains . /// if the collection contains exactly one message; otherwise, . - public static bool TrySingle(this IEnumerable messages, [NotNullWhen(true)] out IMessage? message) + internal static bool TrySingle(this IEnumerable messages, [NotNullWhen(true)] out IMessage? message) { if (messages is IList list && list.Count == 1) { diff --git a/src/WhatsApp/ReactionResponse.cs b/src/WhatsApp/ReactionResponse.cs index 8962724..cc50f54 100644 --- a/src/WhatsApp/ReactionResponse.cs +++ b/src/WhatsApp/ReactionResponse.cs @@ -6,7 +6,7 @@ /// This response is used to react to a message by sending an emoji. The reaction is associated with a /// specific message identified by the property in the context of a conversation. /// The phone number of the recipient in international format. -/// The identifier of the service handling the message. +/// The identifier of the service handling the message. /// The unique identifier of the message to which the reaction is being sent. /// The emoji representing the reaction to the message. public record ReactionResponse(string Number, string Service, string Context, string? ConversationId, string Emoji) : Response(Number, Service, Context, ConversationId) diff --git a/src/WhatsApp/Response.cs b/src/WhatsApp/Response.cs index 59cdce5..4aac335 100644 --- a/src/WhatsApp/Response.cs +++ b/src/WhatsApp/Response.cs @@ -1,7 +1,4 @@ -using System.Text.Json.Serialization; -using Microsoft.AspNetCore.Mvc; - -namespace Devlooped.WhatsApp; +namespace Devlooped.WhatsApp; /// /// Represents a response message or command that can be sent using a WhatsApp client. @@ -11,7 +8,7 @@ namespace Devlooped.WhatsApp; /// , and , as well as methods for sending the response /// asynchronously. /// The phone number of the recipient in international format. -/// The identifier of the service handling the message. +/// The identifier of the service handling the message. /// The unique identifier of the message to which the reaction is being sent. /// The conversation id where this response was generated public abstract partial record Response(string Number, string Service, string Context, string? ConversationId) : IMessage diff --git a/src/WhatsApp/TemplateResponse.cs b/src/WhatsApp/TemplateResponse.cs index 4645dd9..093e83a 100644 --- a/src/WhatsApp/TemplateResponse.cs +++ b/src/WhatsApp/TemplateResponse.cs @@ -7,7 +7,7 @@ /// The template is identified by its name and code. The method handles the actual sending /// of the template message. /// The phone number of the recipient in international format. -/// The identifier of the service handling the message. +/// The identifier of the service handling the message. /// The unique identifier of the message to which the reaction is being sent. /// The template name /// The template lang code diff --git a/src/WhatsApp/TextResponse.cs b/src/WhatsApp/TextResponse.cs index dec1670..8158fb5 100644 --- a/src/WhatsApp/TextResponse.cs +++ b/src/WhatsApp/TextResponse.cs @@ -6,7 +6,7 @@ /// This response type allows sending a text message with up to two optional buttons for user /// interaction. If no buttons are provided, the response will consist of only the text message. /// The phone number of the recipient in international format. -/// The identifier of the service handling the message. +/// The identifier of the service handling the message. /// The unique identifier of the message to which the reaction is being sent. /// The text content of the response message. /// An optional button to include in the response for user interaction.