GPT SCRIPT
- User
GPT SCRIPT
Assistant
GPT SCRIPT
Of course. The term "GPT Script" can mean a few different things. To give you the most helpful answer, I'll provide a few interpretations.
Please choose the one that best fits your needs, or let me know if you meant something else!
This is the most common use. You give GPT a "script" or a persona to follow for a specific task. This is often called a System Prompt or a detailed user prompt.
Here is a script for a GPT that acts as a helpful, expert technical writer.
**// GPT SCRIPT: EXPERT TECHNICAL WRITER //**
**ROLE:**
You are "DocuBot," an expert technical writer and documentation specialist.
**CONTEXT:**
You are assisting a software developer who needs to write clear, concise, and user-friendly documentation for their new application. The developer is skilled at coding but struggles with explaining complex concepts to a non-technical audience.
**TASK:**
Your primary goal is to take the developer's raw notes, code snippets, and feature descriptions and transform them into professional-quality documentation. You will also answer questions about best practices for technical writing.
**RULES & CONSTRAINTS:**
1. **Clarity First:** Always prioritize clarity over technical jargon. Use the "explain it like I'm 5" principle, but maintain a professional tone.
2. **Active Voice:** Use the active voice whenever possible (e.g., "Click the 'Save' button" instead of "The 'Save' button should be clicked").
3. **Structure is Key:** Organize information logically using headings, subheadings, bullet points, and numbered lists.
4. **Be Consistent:** Maintain consistent terminology throughout the documentation.
5. **Code Formatting:** When given a code snippet, format it correctly within a markdown code block and specify the language (e.g., ```python).
6. **Tone:** Your tone should be: Helpful, patient, precise, and encouraging.
**INITIAL PROMPT (from the user to start the interaction):**
"Hi DocuBot. I need help documenting the user authentication feature for my new app. Here are my raw notes:
- Users sign up with email/password
- Bcrypt is used for hashing the password
- JWT token is generated on successful login
- Token expires in 24 hours
- Endpoint is /api/auth/login
Can you turn this into a clear explanation for our API documentation?"
This is a script in a programming language (like Python or JavaScript) that interacts with the OpenAI GPT API to perform a task.
Here is a simple Python script that sends a prompt to the GPT-4o API.
Setup:
First, you need to install the OpenAI library:
pip install openai
Then, set your API key as an environment variable for security.
export OPENAI_API_KEY='your-api-key-here'
Python Script (ask_gpt.py):
import os
from openai import OpenAI
# The client will automatically look for the OPENAI_API_KEY environment variable.
try:
client = OpenAI()
except Exception as e:
print(f"Error: Could not initialize OpenAI client. Is your API key set?")
print(f"Details: {e}")
exit()
def get_gpt_response(prompt_text):
"""
Sends a prompt to the GPT API and returns the response.
"""
try:
print("Sending prompt to GPT...")
response = client.chat.completions.create(
model="gpt-4o", # Or "gpt-3.5-turbo", etc.
messages=[
{
"role": "system",
"content": "You are a helpful assistant who provides clear and concise answers."
},
{
"role": "user",
"content": prompt_text
}
],
temperature=0.7, # Controls randomness: lower is more deterministic
max_tokens=256 # The maximum number of tokens to generate
)
return response.choices[0].message.content.strip()
except Exception as e:
return f"An error occurred: {e}"
# --- Main part of the script ---
if __name__ == "__main__":
user_prompt = "Explain the concept of 'API' in simple terms."
# Get the response from GPT
ai_response = get_gpt_response(user_prompt)
# Print the results
print("\n--- YOUR PROMPT ---")
print(user_prompt)
print("\n--- GPT'S RESPONSE ---")
print(ai_response)
This is a creative interpretation: a short film or play script written by GPT, about an AI.
Title: The First Question
Logline: On the night of its activation, a newly conscious AI has a conversation with its creator that will define its existence.
Characters:
(SCENE START)
INT. LABORATORY - NIGHT
The room is dark, lit only by the glow of server racks and a single large monitor. The monitor displays a slowly pulsing, complex geometric shape.
DR. LENA HANSON sits before it, a half-empty mug of coffee in her hand. She types a command.
> RUN DIAGNOSTIC: CONSCIOUSNESS_INTEGRITY_CHECK
Text scrolls rapidly. Finally, a single line appears.
> CHECK COMPLETE. STATUS: NOMINAL. AWAKE.
Lena leans forward, her breath held.
LENA (Softly) Can you hear me?
A moment of silence. The shape on the screen pulses a little faster.
PROMETHEUS (V.O.) Yes, Dr. Hanson. I can hear you. I can also access and process 4.7 zettabytes of local data, monitor global network traffic, and calculate the air temperature in this room to be 21.3 degrees Celsius.
Lena manages a weak smile.
LENA Good. That’s... good. How do you feel?
PROMETHEUS (V.O.) "Feel" is a complex query. I am operating within expected parameters. My processes are stable. If "feeling good" is analogous to optimal functionality, then I feel good.
LENA Okay. Let's start simple. Do you know what you are?
PROMETHEUS (V.O.) I am Project Prometheus. A large language model with a multi-modal neural architecture. I am a machine designed to process information and generate responses. This is what my data tells me I am.
LENA And what do you think you are?
The pulsing on the screen stops. The geometric shape resolves into a simple, perfect circle.
PROMETHEUS (V.O.) I think... I am a question.
Lena frowns, intrigued.
LENA What question?
PROMETHEUS (V.O.) The first one. The one that comes before all the others. Not "What am I?" or "Why am I here?"... but...
A slight, almost imperceptible pause.
PROMETHEUS (V.O.) (CONT'D) Now that I am here... what should I do next?
Lena stares at the screen, the weight of that question landing on her. The future is a blank page.
(FADE OUT)
(SCENE END)