AI and Web Development: Hype or Reality?

Linda Hubičková
blogs:avatar.publishText13. září 2023

We recently attended the JSNation conference, where the dominant theme was AI. During the event, I discovered simple, yet effective, AI applications in web development that further inspired me in their use. In the initial section, I will describe some of my examples using tools like ChatGPT or GitHub Copilot. In the second part, I will showcase the capability of AI to automatically summarize audio-visual content.

Simple Examples

Let’s see some straightforward, yet highly useful, instances of how to leverage AI in the everyday life of a web developer.

RRR

Designing an API Using Swagger Documentation

An example can be when I need to design an API (such as REST). From verbal instructions, I know what attributes will need to be accepted. Then, all that’s left to do is let AI generate the documentation, including examples.

Prompt: Make swagger documentation for write REST API based on these attributes, unify naming conventions (e.g. camelCase). Dimension attributes are optional, rest attributes are required. Choose appropriate data types. The swagger should contain examples:

Id;Result from Sorter;All scanned barcodes;Height;Length;Width;Parcelbarcode;Routebarcode;Time sorted;Time scanned
chatgpt output

Generating Validation Schema

Following API design, it’s possible to extend by automatically generating a validation schema, for instance, using a popular library like zod.

Analogously, one could have database repositories generated in a chosen library, for example.

Prompt: Give me the validation schema written in zod for this API.

chatgpt output

Generating Mock Data

A classic use case that is suitable for generating test data or even generating mock data for APIs.

Static data can be generated, or you can instruct functions to create dynamic content instead of data objects, using tools like the faker library, for example.

Prompt: Generate test data with TypeScrip types.

Generating Tests

For the same example, we can easily generate tests as well. I can create tests either at the end of the implementation or utilize the Test Driven Development approach.

Prompt: Generate integration tests for this write API. Write tests with jest and supertest. Check if data are stored correctly with TypeOrm. Import mocked data.

chatgpt output

Generating Regex

What if a specification for more robust validation comes up, requiring the use of regular expressions? No problem. AI can handle it effortlessly.

Prompt: I need to make a regex for the parcelBarcode attribute, the requirements are that it should be 16 characters long, it should start with a percent symbol and then a zero. Use regex in zod validation schema.

Generating SQL

I often need to obtain some analytical data. For example, finding out the maximum number of records my service stored in the database in a day and on which date it occurred.

Prompt: Write me an SQL query in MSSQL, where you can find the 10 dates that had the most scanned parcels. The output will be the date and number of the parcels.

chatgpt image

Generating Content Summary Using AI

One of the speakers, Wes Bos, demonstrated a complex and practical example of how AI can generate a podcast summary from a lengthy transcript. He explained that their podcast Syntax has over 600 hours of content, making it challenging for listeners to find specific topics quickly. To address this issue, they utilized an AI tool like ChatGPT to create concise summaries of each podcast episode.

The process involved converting each utterance in the transcript. Next, they formulated a custom prompt for the AI model, providing context about the podcast episode and specifying the desired summary format. The AI model then generated a comprehensive summary based on the given context. The result was a detailed summary of each podcast episode, complete with timestamps for each topic discussed.

By employing AI for this task, they were able to efficiently create informative summaries that allowed listeners to find relevant content easily. The AI-generated summaries also served as valuable material for tweetable content and search-engine optimization.

How have I utilized this idea in my life?

The idea of automatically transcribing audio recordings into text, creating summaries, and a timeline intrigued me. I pondered how to utilize it in my life. While I don’t produce my own podcast, I do have numerous work meetings. To ensure an efficient meeting and transparent actionable steps, taking notes is beneficial.

What if there was a way to automatically record a meeting, transcribe it into text, and create a summary? Instead of building my own tooling for solving this problem, similar to Wes Bos, I found an existing solution — https://tldv.io.

Tl;dv is compatible with Google Meet and Zoom. It can record the entire meeting, provide a textual transcript, and a summary with a timeline. The result is sent via email to meeting participants. On the timeline, you can click and directly switch to the video section where a specific topic is discussed.

Tl;dv produces good results, surprisingly not only in English but also in Czech. However, the best quality results can be achieved when all participants are online. If there are multiple people in one meeting room and they are situated at varying distances from the microphone, the results are compromised even with a high-quality microphone.

tldv

Will AI robots take our jobs?

Will AI robots take our jobs? I don’t believe so. Instead, AI will boost our productivity, allowing us to simplify and automate repetitive tasks, and freeing up time to focus on developing business logic.

Nevertheless, I believe it is essential to stay informed and adaptable as technology continues to advance.

var name = text

Copyright © 2024 All rights reserved