Generative AI Apps Overview
1. ChatGPT (Generative Text AI)
Overview: ChatGPT is an AI language model that generates human-like text based on input.
It is commonly used for natural language conversations, content generation, code generation,
question answering, etc.
Functionality:
- Input: Text-based queries and prompts
- Output: Text-based responses
- Technology: GPT architecture (GPT-4 or other versions)
- Use Cases: Virtual assistants, customer support, education, content creation.
2. DALL·E (Generative Image AI)
Overview: DALL·E is an AI model that generates images based on textual descriptions.
It can create unique images, drawings, or paintings from detailed text prompts.
Functionality:
- Input: A text prompt describing the desired image.
- Output: Generated images or illustrations.
- Technology: A model trained on image-text pairs.
- Use Cases: Digital art creation, advertising, design inspiration, etc.
3. High-Level Architecture Design
ChatGPT Architecture:
User Input --> [ChatGPT API] --> [Preprocessing] --> [AI Model (GPT)] --> [Postprocessing] --> User
Output
| |
DB (for training data)
[External APIs/Services]
DALL·E Architecture:
User Input --> [DALL·E API] --> [Text-to-Image Model] --> Image Generation --> User Output
| |
DB (for image-text pairs)
[External Services (e.g., model fine-tuning)]
4. API Endpoint Documentation
ChatGPT API Endpoints:
1. Generate Text Completion:
- Endpoint: /v1/completions
- Method: POST
- Request Format:
"model": "gpt-4",
"prompt": "Hello, how are you today?",
"max_tokens": 50,
"temperature": 0.7
}
- Response Format:
"id": "abc123",
"object": "text_completion",
"created": 1634555067,
"model": "gpt-4",
"choices": [
"text": "I'm doing well, thank you! How can I assist you today?"
2. Stream Text:
- Endpoint: /v1/completions/stream
- Method: POST
- Request Format:
"model": "gpt-4",
"prompt": "Can you tell me about the weather?",
"stream": true
- Response Format:
"id": "xyz456",
"object": "stream",
"data": "It's sunny and warm today."
DALL·E API Endpoints:
1. Generate Image from Text:
- Endpoint: /v1/images/generations
- Method: POST
- Request Format:
"prompt": "A futuristic city with flying cars",
"n": 1,
"size": "1024x1024"
- Response Format:
"data": [
"url": "https://example.com/generated_image.png"
2. Edit Image (Inpainting):
- Endpoint: /v1/images/edits
- Method: POST
- Request Format:
"image_url": "https://example.com/input_image.png",
"mask": "The area to edit",
"prompt": "Add a sunset in the background"
- Response Format:
"data": [
"url": "https://example.com/edited_image.png"