AI — Generative AI
What is Generative AI?
AI that creates new content (text, images, code).
Types of Generative AI
| Type | Description | Example |
|---|---|---|
| LLM | Language models | GPT, Claude |
| Image | Image generation | DALL-E, Midjourney |
| Code | Code generation | Copilot |
| Audio | Audio generation | ElevenLabs |
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
- Understand generative AI
- Try text generation
- Generate images
- 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.