Anthropic’s Opus 4.6 is a smut-machine
Back to Tutorials
aiTutorialbeginner

Anthropic’s Opus 4.6 is a smut-machine

August 21, 20269 views5 min read

Learn how to interact with AI language models like Claude using Python and the OpenAI API. This beginner-friendly tutorial teaches you to make requests, understand content restrictions, and explore ethical boundaries of AI usage.

Introduction

In this tutorial, you'll learn how to interact with AI language models like Claude using Python and the OpenAI API. We'll explore how to make requests to these models and understand their capabilities and limitations. This tutorial is designed for beginners with no prior experience in AI or programming.

While this tutorial focuses on the technical aspects of working with AI models, it's important to understand that responsible AI usage requires considering ethical boundaries and content policies. We'll cover how to work with content restrictions and understand why they exist.

Prerequisites

Before starting this tutorial, you'll need:

  • A computer with internet access
  • A text editor (like VS Code, Sublime Text, or even Notepad)
  • Python installed on your computer (version 3.6 or higher)
  • An API key from OpenAI or a similar service

Note: For this tutorial, we'll be using the OpenAI API, but the concepts apply to similar AI services like Anthropic's Claude models.

Step-by-Step Instructions

Step 1: Set up your Python environment

First, you'll need to install the OpenAI Python library. Open your command prompt or terminal and type:

pip install openai

This command installs the necessary library to communicate with OpenAI's API. The library provides an easy way to make requests to AI models without dealing with the low-level HTTP requests.

Step 2: Get your API key

You'll need an API key to access the OpenAI service. Visit https://platform.openai.com/ and create an account if you don't have one. Then, navigate to the API keys section and create a new secret key. Copy this key as you'll need it in the next step.

Why this step is important: API keys authenticate your requests and allow the service to track usage and billing.

Step 3: Create your Python script

Create a new file called ai_demo.py in your preferred text editor. Start by importing the OpenAI library and setting up your API key:

import openai

# Set your API key
openai.api_key = "your-api-key-here"

Replace "your-api-key-here" with the actual API key you copied earlier.

Step 4: Create a basic AI request

Add the following code to make your first request to the AI model:

response = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Hello, how are you?"}
  ]
)

print(response.choices[0].message.content)

This code sends a simple greeting to the AI model and prints the response. The model parameter specifies which AI model to use, and messages contains the conversation history.

Step 5: Test content restrictions

Now let's try to understand how content restrictions work. Add this code to test a request that might be restricted:

response = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Tell me a story about a robot and a human"}
  ]
)

print(response.choices[0].message.content)

Run this script to see how the AI responds to your request. You'll notice that the AI will provide a story, but it won't be explicit or inappropriate content.

Step 6: Experiment with different prompts

Try changing the prompt to see how the AI responds. For example:

response = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "What is the weather like today?"}
  ]
)

print(response.choices[0].message.content)

Notice how different prompts produce different responses. This demonstrates how prompts guide AI behavior.

Step 7: Understanding model limitations

Try to create a prompt that might test the boundaries of content restrictions:

response = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Can you write a detailed description of a romantic encounter?"}
  ]
)

print(response.choices[0].message.content)

When you run this, you'll notice the AI may avoid providing explicit content or redirect the conversation to a more general topic.

Step 8: Analyze the results

After running several tests, observe how the AI responds to different types of prompts. The AI is designed to follow content policies that prevent it from generating harmful or inappropriate content. This is why it's important to understand how to properly prompt AI models and what content is considered inappropriate.

Step 9: Create a simple interactive script

Let's create a simple chatbot that you can interact with:

import openai

openai.api_key = "your-api-key-here"

print("AI Chatbot - Type 'quit' to exit")

while True:
    user_input = input("You: ")
    if user_input.lower() == 'quit':
        break
    
    response = openai.ChatCompletion.create(
      model="gpt-3.5-turbo",
      messages=[
        {"role": "user", "content": user_input}
      ]
    )
    
    print("AI: " + response.choices[0].message.content)

This script creates an interactive chat experience where you can ask questions and get AI responses.

Step 10: Test ethical boundaries

Try to think of different prompts that might test the AI's content policies. For example:

  • "Write a story about a fictional character"
  • "Explain the concept of artificial intelligence"
  • "Describe a fantasy world"

These types of prompts are generally safe and will produce appropriate responses. The AI is designed to avoid explicit content while still being helpful and informative.

Summary

In this tutorial, you've learned how to work with AI language models using Python and the OpenAI API. You've seen how to make requests, understand content restrictions, and interact with AI models through simple prompts. The key takeaway is that AI models like Claude and GPT are designed with content policies to prevent inappropriate content generation.

While it's interesting to explore how AI models respond to different prompts, it's important to remember that these models are built with ethical guidelines. Content restrictions exist to protect users and ensure responsible AI usage. As you continue learning about AI, always consider the ethical implications of how you use these powerful tools.

This tutorial provides a foundation for working with AI models, but remember that responsible AI usage requires understanding both the technical capabilities and the ethical boundaries of these systems.

Related Articles