Transform Static Documents into Actionable Knowledge with AIKit
Large reports, contracts, or documentation files often contain more information than can be quickly processed. Wouldn’t it be nice if you could simply upload a document PDF from your 4D application and let AI help you summarize it, extract key data, or answer questions about its content?
Thanks to the new OpenAI.files class, this workflow is now very simple. You can seamlessly upload files and use AI to interact with their content in many ways.
Searching Across Host Projects and Components in 4D
When working on a large 4D application, it is common to split functionality across a host project and several components. This modular architecture keeps things clean, easy to organize, and maintainable, but it can also create a challenge: figuring out where a method is used.
Since 4D 21, a major improvement has made this workflow even smoother: you can now edit a component’s source code directly from the host project, without switching contexts. And with 4D 21 R2, the Find in Design dialog has been enhanced to search not only within the host project, but also across all accessible components created in project mode with their source code available.
4D View Pro: What’s new in 4D 21 R2
4D 21 R2 introduces an updated version of 4D View Pro based on SpreadJS v18.2, along with a Ribbon fully compatible with this release. Since 4D View Pro is built on top of SpreadJS, upgrading the underlying engine immediately brings performance improvements and new capabilities. Some of these enhancements are directly available in 4D, others can be accessed through the View Pro designer, and a few require custom JavaScript code. In this article, we highlight the most important changes introduced by SpreadJS v18.2, including features that are not yet directly exposed as 4D functions.
Give Your Components a Visual Identity with Custom Icons
When working on a project with multiple components, quickly identifying the one you need can save valuable time. The simplest and most effective way to make your components stand out in the Project Dependencies is to give each one a custom icon. 4D 21 R2 lets you visually distinguish your components at a glance, simply by placing a logo.png or logo.svg file in its Resources folder.
4D AI: Sorting Query Results by Vector Similarity
In the Semantic search: querying by vector similarity post, we introduced how to query entities using vector similarity, a powerful way to find the most relevant records based on meaning rather than exact values.
4D 21 R2 comes with a new way to sort query results using 4D.Vector fields. You can not only filter entities by similarity but also sort your query results using the .query() function so that the most relevant and semantically closest entities appear first. Whether you’re building an intelligent search experience, a recommendation engine, or an AI-driven assistant, this new feature ensures that your results are ordered by relevance, providing more accurate and user-friendly outcomes.
Better Error Handling and Type Inference for 4D Developers
When you’re coding in 4D or VS Code, clear and precise feedback from the editor makes all the difference. It helps you understand what’s happening in your code, fix issues faster, and keep your focus on building great features.
Starting with 4D v21 R2, we’ve improved the check syntax of the code editor to make error detection and type inference more accurate and consistent in both 4D and VS Code.
4D NetKit: Secure OpenID Authentication with nonce attribute
When working with modern authentication flows, security is paramount. Developers often need to integrate authentication with trusted identity providers such as Google or Microsoft. This is where OpenID Connect (OIDC) comes into play.
OIDC is an identity layer built on top of OAuth 2.0. It allows your application to verify the identity of a user and to obtain basic profile information in a secure way. Starting with the latest enhancements to the cs.NetKit.OAuth2Provider class, 4D 21 now makes it easier to work with OpenID Connect by supporting the nonce parameter, along with new token attributes, including the id_token.
Trim, Trim start, and Trim end in 4D
When working with user input, data cleaning, or text formatting, one of the most common tasks is removing unwanted whitespace. Whether it’s a space accidentally typed before an email address or a newline character left at the end of a copy-paste, these seemingly invisible characters can cause unexpected behavior in your applications.
Fortunately, 4D 21 provides easy-to-use string methods to help: Trim, Trim start, Trim end.
4D NetKit: Decoding, Generating, and Validating JWT
JSON Web Tokens (JWT) have become a key standard for secure authentication and information exchange between systems. With JWT, you can transmit data in a secure, verifiable, and standardized way, reducing complexity while improving security. In particular, JWTs are essential when working with OpenID Connect, where they allow you to validate and decode the information returned by the OpenID provider.
Within the 4D 21, 4D NetKit provides a simple API to handle these tokens: decoding, generation, and validation.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy
