Create a chatbot in the console with Azure OpenAI and C#
Swimburger.net
by Niels Swimberghe
1y ago
ChatGPT went viral shortly after it was launched by OpenAI. Within just a couple of weeks, ChatGPT went from something only technical computer people knew about, to quickly being adopted by kids and teenagers to help them "cheat" on schoolwork. Not much later, even my non-technical friends started experimenting with ChatGPT and Bing chat, without me ever mentioning it to them. Since then, OpenAI has opened up an API for ChatGPT, but in addition to that, Azure has been working with OpenAI to offer its own version of OpenAI's models through Azure, adding on the security, integration, and manage ..read more
Visit website
Change the ServiceLifetime after the service has been added to the .NET ServiceCollection
Swimburger.net
by Niels Swimberghe
1y ago
ASP.NET Core has a built-in dependency injection container that many libraries provide helpers for to conveniently integrate the libraries. In some cases, though, the ServiceLifetime of the added services is not the lifetime you want to use. To change the lifetime, you could look at the source code and replicate how the library adds the service to the ServiceCollection while specifying a different ServiceLifetime. However, the library may change over time and now your replica is out of date. While the dependency injection container is built into ASP.NET Core, you can also use it in any other t ..read more
Visit website
How to build a URL Shortener with C# .NET and Redis
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. URLs are used to locate resources on the internet, but URLs can be long making them hard to use. Especially when you have to type the URL manually, even more so when having to do so on a mobile phone. Long URLs are also problematic when you have a limited amount of characters such as within an SMS segment or a Tweet. A solution to this is to use a URL shortener which will create URLs that are short and sweet. When you open the shortened URL, the URL will forward you to the long destination U ..read more
Visit website
Use XML Literals in Visual Basic .NET to generate TwiML
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. While JSON and YAML have become very popular data serialization languages, XML is still everywhere. XML is used on the HTML page you are reading right now. XML is used in your .NET project files and MSBuild scripts. Twilio also has their own flavor of XML called TwiML, but more on that later. If you need to work with XML and are a Visual Basic .NET (VB) developer, then you're in luck because VB has a built-in feature for generating XML called XML Literals. In this tutorial, you'll learn how to generate TwiML wi ..read more
Visit website
Announcing the Webhook Plugin: Validate your webhooks with the new webhook plugin for the Twilio CLI
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. At Twilio, we heavily use webhooks throughout all of our products, but developing and testing webhooks comes with some challenges. First, you need to make your application running on localhost public, then you have to configure the webhook with your public URL, and then you have to trigger those webhooks by manually texting or calling your Twilio Phone Number. This can be cumbersome and slows down your inner devloop. To address these challenges, Twilio Labs created the Webhook plugin for the Twilio CLI, to test ..read more
Visit website
How to generate TwiML using Strings in C#
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. Over the decades, C# has added different ways to create a string, each with their own benefit. In this tutorial, you'll learn how to generate TwiML using the different C# string features with an ASP.NET Core Minimal API and compare it to the object oriented way of generating TwiML. But first, let's get you up to speed on how Twilio uses webhooks and TwiML to respond to text messages and voice calls. Prerequisites Here's what you will need to follow along: .NET 6 SDK, or .NET 7 SDK to u ..read more
Visit website
Use Raw String Literals to generate TwiML in C# 11
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. Over the decades, C# added different ways to create a string, each with their own benefit, and C# 11 is adding another way: Raw String Literals. There are many use cases for Raw String Literals, and one of those use cases is to generate TwiML, but more on that later. In this tutorial, you'll learn how to generate TwiML with Raw String Literals with an ASP.NET Core Minimal API. Prerequisites Here's what you will need to follow along: .NET 7 SDK (later versions will work too) A code edit ..read more
Visit website
Use Visual Studio dev tunnels to handle Twilio Webhooks
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. Visual Studio recently introduced a new feature called dev tunnels. By using dev tunnels, Visual Studio will create a new public URL (tunnel URL) for you, and HTTP requests sent to the tunnel URL will be forwarded to your ASP.NET Core project running on localhost. Dev tunnels has a lot of use cases. You could use this to easily test your web application on other devices like mobiles phone and tablets. You could also use this to make your application temporarily, publicly available for d ..read more
Visit website
Provide default configuration to your .NET applications
Swimburger.net
by Niels Swimberghe
1y ago
This blog post was written for Twilio and originally published at the Twilio blog. In a previous post I shared how you can better configure your .NET applications for Twilio and SendGrid using the Microsoft.Extensions.Configuration APIs. In this tutorial, I'll build upon the techniques from those tutorials and you'll learn how to store default options in one section of your configuration and override them with specific options from another section. Let me clarify using an example. Applications often send different types of emails, like welcome emails, password reset emails ..read more
Visit website
How to create an ASP.NET Core Minimal API with Visual Basic .NET (there's no template)
Swimburger.net
by Niels Swimberghe
1y ago
Visual Basic .NET (VB) is not dead, but it's not getting the same amount of love as C# or even F#. That is instantly clear when you list the available templates that come with the .NET SDK: Only 6 out 23 project templates have support for VB, while F# has support for 10, and C# has support for all of them. However, this does not mean you cannot recreate the C# template in VB. In this tutorial, you'll see how you can start from the VB console template, and update it to a ASP.NET Core Minimal API project. Prerequisites To follow along you'll need to have the .NET 6 SDK or newer on your machine ..read more
Visit website

Follow Swimburger.net on FeedSpot

Continue with Google
Continue with Apple
OR