Posts

[MS] .NET 9 中的 OpenAPI 文档生成 - devamazonaws.blogspot.com

本文翻译自 Mike Kistler 的 OpenAPI document generation in .NET 9 .NET 9 中的 ASP.NET Core 通过引入全新的对OpenAPI 文档生成功能的内置支持,简化了为 API 端点创建 OpenAPI 文档的过程。这项新功能旨在简化开发工作流程,并改善 OpenAPI 定义在 ASP.NET 应用中的集成。 OpenAPI 的广泛使用催生了丰富的工具和服务生态系统,它们能够帮助您更高效地构建、测试和记录 API。例如, Swagger UI 、 Kiota 客户端库生成器 和 Redoc 等,当然还有许多其他工具。  为什么选择 OpenAPI?   OpenAPI 是定义和记录 HTTP API 的强大工具。它提供了一种标准化方式来描述 API 的端点、请求和响应格式、身份验证方案以及其他重要细节。这种标准化使开发人员能够更轻松地了解和与API进行交互,从而促进更好的协作并构建更强大的应用程序。  此外,许多大型语言模型(LLMs)已在 OpenAPI 文档上进行了训练,使其能够自动生成代码、测试用例和其他工件。通过为您的 API 生成 OpenAPI 文档,您可以利用这些 LLM 来加速开发流程。  .NET 9 中的新功能?   在 .NET 9 中,我们引入了对 OpenAPI 文档生成功能的内置支持,为 .NET 开发人员提供了更集成、更流畅的体验。此功能可用于Minimal API 和基于控制器的应用程序。以下是一些关键亮点:  支持在运行时生成 OpenAPI 文档,并通过应用程序上的端点访问它们,或在构建时生成文档。  用于将元数据添加到 API 方法和数据的属性和扩展方法 。  支持“转换器”API,允许以多种方式修改生成的文档。  支持从单个应用程序生成多个 OpenAPI 文档。  利用 System.Text.Json 提供的 JSON schema 支持。  与Minimal API 结合使用时,兼容原生 AoT(Ahead-of-Time)编译。  如何入门   在 .NET 9 中使用新的 O...

[MS] Improve the “R” in RAG and embrace Agentic RAG in Azure SQL - devamazonaws.blogspot.com

Image
The RAG (Retrieval Augmented Generation) pattern, which is commonly discussed today, is based on the foundational idea that the retrieval part is done using vector search. This ensures that all the most relevant information available to answer the given question is returned and then fed to an LLM to generate the final answer. While vector search is great for its specific use case - semantic search, which is approximate by nature - it fails when it comes to searching for precise questions, like 'show me the latest 10 code samples,' as that request can - and should - be answered precisely without the need for vector search. Users are becoming more accustomed to working with AI on a daily basis. They are also starting to expect the AI to "understand" when a semantic answer is most appropriate or when a precise search is the right approach. RAG needs to be improved in order make that possible. Let's see an option that can be implemented right away. Hybrid (or Agentic...

[MS] Memory corruption from outside the process looks like space aliens - devamazonaws.blogspot.com

Chasing down memory corruption is one of the more frustrating parts of debugging. You can use debugger write breakpoints and tools like Address Sanitizer (ASAN), Valgrind , Application Verifier (AppVerifier), and Page heap to try to identify memory corruption bugs in real time. And you can use tools like rr , and Time Travel Debugging (TTD) to record the execution of a program and replay it. But all of these tools can only track writes that were issued by the program being debugged. If the offending write comes from outside the process, then all your program sees is a mysterious change in the value even though the program never modified it. (As far as you can determine, it was changed by space aliens .) You can use this knowledge to your advantage: If you see a memory change that is not detected by a write breakpoint or Time Travel Debugging, then you can add to the list of scenarios the possibility that the memory is being updated from outside the process, say by kernel mode ( e...

[MS] Be mindful of temporal terms in documents: What is the reference point in time? - devamazonaws.blogspot.com

In documents like feature proposals or pull requests, be careful with words referring to points in time, because it's not always clear what the implied point of reference is. For example, there might be a discussion in the pull request that goes like this: Person 1: "If the file is missing, what happens?" Person 2: "Currently, it crashes if the file is missing." There is ambiguity here in what "currently" is referring to. "currently in the repo": As things stand now (before my changes), it crashes if the file is missing. "currently in the pull request": If you build with the changes in the pull request, it crashes if the file is missing. (It didn't crash before I made the changes.) A similar ambiguity exists in feature proposal documents. There will be a method for reversing the polarity of the neutron flow. What is the reference point for the future tense? This feature proposal includes a method for reversing the...

Amazon EC2 introduces provisioning control for On-Demand Capacity Reservations in the AWS GovCloud (US) Regions - devamazonaws.blogspot.com

Amazon EC2 introduces new capabilities that make it easy for customers to target instance launches on their On-Demand Capacity Reservations (ODCRs) . On-Demand Capacity Reservations help you reserve compute capacity for your workloads in a specified Availability Zone for any duration. You can now ensure instance launches are fulfilled exclusively by ODCRs, or prefer unutilized ODCRs before falling back to On-Demand capacity. To get started, you can specify your capacity reservation preferences for your EC2 Auto Scaling groups via the AWS Console or the AWS CLI. These preferences can also be configured using EC2 RunInstances API calls. These features are available in both of the AWS GovCloud (US) Regions. To learn more, see the Capacity Reservations user guide and EC2 Auto Scaling user guide.   Post Updated on January 22, 2025 at 06:00PM

AWS IoT SiteWise now supports null and NaN data types - devamazonaws.blogspot.com

Today, Amazon Web Services, Inc. announces that AWS IoT SiteWise now supports NULL and NaN (Not a Number) data of bad or uncertain data quality from industrial data sources. AWS IoT SiteWise is a managed service that makes it easy to collect, store, organize, and analyze data from industrial equipment at scale. This new feature enhances the services capability to handle a wider range of data, improving its utility for industrial applications. With this update, AWS IoT SiteWise now collects, stores, and retrieves real-time or historical NULL values for all supported data types. It also supports NaN values of double data type. Capturing NULL and NaN data is critical for various industrial use cases, including compliance reporting, observability, and downstream analytics, while also simplifying data set conditioning and cleaning for advanced analytics and machine learning applications. This new feature is available in all AWS Regions where AWS IoT SiteWise is available. To learn mor...

CloudWatch provides execution plan capture for Aurora PostgreSQL - devamazonaws.blogspot.com

Amazon CloudWatch Database Insights now collects the query execution plans of top SQL queries running on Aurora PostgreSQL instances, and stores them over time. This feature helps you identify if a change in the query execution plan is the cause of performance degradation or a stalled query. Execution plan capture for Aurora PostgreSQL is available exclusively in the Advanced mode of CloudWatch Database Insights. A query execution plan is a sequence of steps that database engines use to retrieve or modify data in a relational database management system (RDBMS). The RDBMS query optimizers may not always choose the most optimal execution plan from a set of alternative ways to execute a given query. Hence, database users sometimes need to manually examine and tune the plans to improve performance. This feature allows you to visualize multiple plans of a SQL query and compare them. It can help you determine if a change in performance of a SQL query is due to a different query execution p...