Table of Contents

Lab 08 - AI Tools

Introduction

In this lab, we will explore AI-driven development tools and their applications in building modern web applications. You will learn about the following tools:

By the end of this lab, you will build a simple Next.js chat application, with UI components created using V0/Lovable and all of this logic implemented using Cursor (or other AI powered IDE).

What is Generative AI?

Generative AI refers to artificial intelligence systems that can generate new content, such as text, images, videos, or audio, based on patterns they’ve learned from existing data. Unlike traditional AI models that classify or predict based on input data, generative AI creates new and unique outputs.

Core Capabilities

Applications of Generative AI

ChatGPT

Overview

ChatGPT is one of the most well-known examples of generative AI, developed by OpenAI. It uses large language models like GPT-3.5 and GPT-4 to understand and generate human-like text. ChatGPT is versatile and can handle tasks ranging from answering questions to writing essays or generating code.

Key Features

Gemini

Overview

Gemini is Google's generative AI model, designed to combine advanced language understanding with cutting-edge capabilities in vision and multimodal reasoning. Released as part of Google DeepMind's AI ecosystem, Gemini aims to bring generative AI into various professional and creative domains.

Key Features

Claude

Overview

Claude is a conversational AI developed by Anthropic, designed with a focus on safety, ethical behavior, and robust reasoning. It competes with ChatGPT in providing conversational and creative AI solutions.

Key Features

Comparison of ChatGPT, Gemini, and Claude

Feature ChatGPT Gemini Claude
Developer OpenAI Google DeepMind Anthropic
Key Strength Versatility in text generation Multimodal capabilities Safety and ethical alignment
Target Audience General-purpose, developers Businesses, creators Businesses, ethical users
Notable Use Cases Chatbots, education, programming Image-text applications, content Customer service, knowledge ops

Using Generative AI Effectively: How to Ask Good Questions

Generative AI tools (such as ChatGPT, Gemini, Claude, etc.) are only as useful as the questions you ask them. This section presents simple prompting strategies that help you obtain clearer, more actionable answers — whether you are coding, learning a new topic, writing, or planning a project.

1. Start with a clear objective

Avoid very generic questions like:

Instead, tell the AI exactly what you want:

You can think in terms of:

2. Give context, not just a question

The same question can have very different good answers depending on context. For example, instead of:

you can say:

Useful types of context:

The more relevant context you give, the more tailored the answer will be.

3. Define a role for the AI

You can ask the AI to “act as” a particular kind of expert. This helps it tune the style and level of the response.

Examples:

This does not change the underlying model, but it often leads to more useful answers, especially for explanations or feedback.

4. Specify constraints and output format

If you know how you want the answer to look, say it explicitly.

Examples of constraints:

Examples of output formats:

This is especially useful when you plan to copy the answer into code, documentation, slides or another tool.

5. Ask for structure and depth

You can ask the AI to structure the answer in multiple layers:

This helps you quickly get an overview, and then dive deeper only if needed.

6. Work iteratively (use follow-up questions)

Good use of AI is rarely “one prompt and done”. Treat the AI as a collaborator and refine the answer:

Each follow-up can:

7. Ask for assumptions and limitations

Generative AI can be wrong or incomplete. You can explicitly ask it to show its own uncertainty:

This is useful when you use AI for decisions, research, or learning and want to be aware of possible gaps.

8. Examples of good general-purpose prompts

Below are several example prompts you can adapt for your own use.

a) Learning a new concept

Act as a university tutor in computer science.
I am trying to understand [concept].
1) Explain it in simple terms.
2) Give a small concrete example.
3) Mention the most common mistakes students make with this concept.
Keep the explanation under 15 lines.

b) Asking for code help

Act as a senior [language/framework] developer.
I will paste a piece of code.
Tasks:
1) Explain what the code does.
2) Point out any potential bugs or edge cases.
3) Suggest improvements for readability and structure.
4) Show an improved version of the code.

c) Improving a piece of writing

Act as an editor.
I will paste a short text in English.
Improve grammar, clarity, and style, but keep my original meaning and tone.
Then briefly explain the most important changes you made.

d) Planning and organisation

Act as a study coach.
I need to prepare for an exam in [subject] in 3 weeks.
I can study about 1.5 hours per day.
Create a weekly study plan with concrete tasks for each day.
At the end, list 3 tips on how to stay consistent.

These examples illustrate the typical structure of a good prompt:

Using these strategies will make generative AI a much more effective assistant for your projects, studies, and everyday tasks.

V0

Overview

V0 is a visual development platform that enables rapid prototyping and development of user interfaces. It allows developers and designers to create UI components visually, reducing the need for manual coding of UI elements. (similar tools: lovable, bolt.new, Replit AI)

V0

History

V0 emerged in the landscape of low-code/no-code development tools, which have gained popularity in recent years to bridge the gap between design and development. The goal of such tools is to accelerate the development process and make it accessible to a wider audience, including those with limited coding experience.

Key Benefits

V0 npm response

V0 npm response

Usage in the Lab

In this lab, you will use V0 to design the frontend of your chat application, creating components like the chat window, input field, and send button. This will allow you to focus on functionality without spending excessive time on UI coding.

Cursor

Overview

Cursor is an AI-powered Integrated Development Environment (IDE) designed to enhance developer productivity through intelligent code suggestions and assistance. Cursor uses machine learning models to provide context-aware code completions, refactoring suggestions, and error detection.

Cursor landing page

History

The development of Cursor is part of the broader trend of integrating AI into software development tools. With advances in machine learning and natural language processing, tools like Cursor aim to augment the capabilities of developers, allowing them to write code more efficiently and with fewer errors.

Key Features

Cursor suggestions Cursor knowledge

Usage in the Lab

You will use Cursor to implement your chat application. The AI assistance will help you write efficient code.

GitHub Copilot

Overview

GitHub Copilot is an AI-powered code completion tool developed by GitHub in collaboration with OpenAI. It uses OpenAI's Codex model, which is trained on a vast dataset of public code repositories, to provide code suggestions and generate code snippets based on comments and existing code. Now copilot support multiple LLM's from OpenAI, Antropic or Google

GitHub copilot

History

Released in technical preview in June 2021, GitHub Copilot represents a significant advancement in AI-assisted programming. It aims to assist developers by suggesting code snippets and functions, thereby reducing the amount of boilerplate code they need to write manually.

Key Features

Usage in the Lab

While GitHub Copilot is not a primary tool in this lab, it can be used to assist with coding tasks, providing suggestions and speeding up development as you work on your project.

ChatGPT API

Overview

ChatGPT API provides developers with access to OpenAI's powerful language models, such as GPT-4, GPT-4.1, GPT-5, GPT-5.1, enabling the integration of natural language understanding and generation into applications.

History

OpenAI released GPT-3 in June 2020, which was followed by the development of ChatGPT, a model fine-tuned for conversational interactions. The ChatGPT API was made available to developers to harness the capabilities of these models in their own applications, allowing for a wide range of use cases, from chatbots to content generation.

Key Features

Tasks

  1. Download the generated project se-lab8-tasks.zip (run `npm install` and then `npm run dev`).
  2. Read the section “Using Generative AI Effectively: How to Ask Good Questions” from this lab. Then, interact with at least one generative AI tool (ChatGPT, Gemini, Claude, etc.) and:
    • use it to refine the requirements and UX for your chat application, and
    • use it to generate or improve a part of your work (e.g., code snippet, test, error message copy, or help text)
  3. Use V0 to design the frontend of your chat application:
    • chat window
    • message list
    • input field
    • send button
  4. Implement the chat logic of your application using Cursor / V0 / ChatGPT / other tools:
    • you may use a simple local/mock backend or hardcoded responses,
    • you are encouraged to use AI tools while coding,
    • you do NOT have to integrate any external API (e.g., ChatGPT API) in your project.
  5. Add a Privacy Policy / Terms of Service section to your application using a generative AI tool.
    • Clearly prompt the AI with the context of your app (what it does, what data it handles).
    • Adapt the generated text to your project if needed.
  6. Bonus (optional): Use AI-generated images (Leonardo.AI, DALL·E, Stable Diffusion, etc.) for your chatbot avatar or UI elements.