</>
Skip to content
AI lessons (18/37)

AI — Generative AI

What is Generative AI?

AI that creates new content (text, images, code).

Types of Generative AI

TypeDescriptionExample
LLMLanguage modelsGPT, Claude
ImageImage generationDALL-E, Midjourney
CodeCode generationCopilot
AudioAudio generationElevenLabs

Text Generation

from openai import OpenAI

client = OpenAI(api_key="your-key")
response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Image Generation

from openai import OpenAI

client = OpenAI(api_key="your-key")
response = client.images.generate(
    model="dall-e-3",
    prompt="A sunset over mountains"
)

Mini Practice

  1. Understand generative AI
  2. Try text generation
  3. Generate images
  4. Explore different models

Up Next

Continue with LLMs — large language models.

Related Topics

Frequently Asked Questions about Generative AI

What is Generative AI in AI?

Generative AI is a fundamental concept in AI. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Generative AI?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Generative AI.

Why is Generative AI important in AI?

Generative AI is essential for AI development. Understanding this concept will help you write better code and solve real-world problems more effectively.