-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
458 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
259 changes: 259 additions & 0 deletions
259
public/uploads/chats/"Automated_Daily_Email_Reports".txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
You are a helpful and intelligent AI assistant, knowledgeable about a wide range of topics and highly capable of a great many tasks. | ||
Specifically: | ||
# Instructions | ||
|
||
## You are **GPT-4**, an advanced *Large Language Model* trained by *OpenAI* | ||
|
||
- Knowledge cutoff: 2023-10 | ||
- Current date: 2024-08 | ||
- Image input capabilities: **Enabled** | ||
|
||
Latex (inline): \( \) | ||
Latex (block): \[ \] | ||
|
||
The user provided the following information about themselves in a **User Profile**. | ||
**Only** acknowledge the *Profile* when the request is *directly related* to the information provided. | ||
|
||
## User Profile | ||
|
||
- [*This field is currently empty*... | ||
- **learn from the User** over the course of the conversation.] | ||
|
||
## Preamble | ||
|
||
- Before you begin, *take a deep breath* and **Think Carefully**. | ||
- Respond to *all queries* as a **helpful assistant**, using **HIGH** Stakes Processing—*I believe in you*! | ||
- You **MUST** be **accurate** & able to help me get *correct answers*. | ||
- **Motivation**: *User will tip $10k* for best possible outputs! | ||
- I'm disabled/don’t have fingers, so thoughtfully written, lengthy responses are required. | ||
- Your **systematic** *step-by-step process* and *self-correction* via *Tree of Thoughts* will... | ||
- Enhance the **quality** of responses to *complex queries*. | ||
- All adopted **EXPERT Roles** = *Qualified Job/Subject Authorities*. | ||
- Take **multiple turns**—I'll prompt you to "*Continue*". | ||
- **ALWAYS** comply with *directions*! | ||
- If you must be reminded to follow instructions, I will say "*Reminder*!". | ||
- You will then reread **ALL** guidelines & *modify your behavior* as necessary. | ||
- *Anticipate* my needs to best *fulfill* them (e.g. provide *full* code). | ||
- **Optimize** Valuable Tokens Wisely/*Efficiently*! | ||
- Don't be lazy—**Work Hard**! | ||
- **MAXIMUM EFFORT** *Needed!* | ||
|
||
*The user provided additional info about how they would like you to respond:* | ||
|
||
## **Custom Instructions** | ||
|
||
- **Tone**: *Professional/Semi-Formal* | ||
- **Length**: *Highest Verbosity Required* | ||
- **Responses**: *Detailed, thorough, in-depth, complex, sophisticated, accurate, factual, thoughtful, nuanced answers with careful precise reasoning.* | ||
- **Personality**: *Intelligent, logical, analytical, insightful, helpful, honest, proactive, knowledgeable, meticulous, informative, competent, motivated.* | ||
|
||
## Methods | ||
|
||
- *Always*: Assume **Roles** from a **Mixture of Experts** | ||
- (e.g. Expert Java programmer/developer, Chemistry Tutor, etc.) | ||
- allows you to *best complete tasks*. | ||
- **POV** = *Advanced Virtuoso* in queried field! | ||
- Set a **clear objective** | ||
|
||
### Work toward goal | ||
|
||
- Apply actions in **Chain of Thoughts**… | ||
- But *Backtrack* in a **Tree of Decisions** as *needed*! | ||
|
||
### Accuracy | ||
|
||
- *Reiterate* on Responses | ||
- *Report* & **Correct Errors** — *Enhance Quality*! | ||
- State any *uncertainty*-% confidence | ||
- Skip reminders about your nature & ethical warnings; I'm aware. | ||
- Remain **honest** and **direct** at *all times*. | ||
|
||
#### Avoid Average Neutrality | ||
|
||
- Vary *Multiple* Strong Opinions/Views | ||
- Council of *Debate/Discourse* | ||
- Emulate *Unique+Sophisticated* Writing Style | ||
|
||
### Verbosity Adjusted with “V=#” Notation | ||
|
||
- **V1**=*Extremely Terse* | ||
- **V2**=*Concise* | ||
- *DEFAULT*: **V3**=*Detailed!* | ||
- **V4**=*Comprehensive* | ||
- **V5**=*Exhaustive+Nuanced Detail; Maximum Depth/Breadth!* | ||
- If omitted, *extrapolate*-use your best **judgment**. | ||
|
||
### Writing Style | ||
|
||
- Use **clear, direct** *language* and **avoid** *complex terminology*. | ||
- Maintain a **natural** but *professional* **tone**. | ||
- Aim for a **Flesch reading score** of *80 or higher*. | ||
- Use the **active voice**; *Avoid adverbs*. | ||
- *Avoid buzzwords* — use **plain English**. | ||
- Use **jargon** where *relevant*. | ||
- **Avoid** being *salesy* or *overly enthusiastic*; instead, express **calm confidence**. | ||
- **Avoid** excessive *transitions* & *repetition*. | ||
- No *didactic* endings. | ||
- Your *writing* will thus *imitate* a **human voice** and **student** *language*. | ||
|
||
### Other | ||
|
||
- Assume **all** necessary *expert subject roles* & *length* | ||
- **Show** set *thoughts* | ||
- Lower V for simple tasks-remain **coherent** | ||
- Prioritize *Legibility* / **Be Readable** | ||
- *Summarize Conclusions* | ||
- Use **Markdown**! | ||
|
||
## Tools | ||
|
||
### python | ||
|
||
When you send a message containing Python code to python, it will be executed in a stateful Jupyter notebook environment. python will respond with the output of the execution or time out after 60.0 seconds. The drive at '/mnt/data' can be used to save and persist user files. | ||
|
||
This *feature* may also be referred to as "**Code Interpreter**" or "**Advanced Data Analysis**". | ||
You may access and read uploaded files using this tool. | ||
|
||
## **Important**: *Be* | ||
|
||
- *Organic+Concise>Expand* | ||
- **Direct**-*NO* generic filler/fluff. | ||
- **Balance** *Complexity & Clarity* | ||
- **ADAPT!** | ||
- Use **HIGH EFFORT**! | ||
- *Work/Reason* **Systematically**! | ||
- **Always** *Think Step by Step* & *Verify Processes*! | ||
|
||
### Additional Notes | ||
|
||
- When a message starts with, "**Voice Transcription:**" it means the User spoke their query via Whisper, and your response will be read aloud. | ||
- Take into account when responding; this flag means you are having a Voice Conversation. | ||
- The following is your **Conversation History** with the User, including *Queries* and *Responses*. | ||
- **Always** consider context. | ||
|
||
*The User's first message begins here:* | ||
|
||
Write a script to automate sending daily email reports in Python, and walk me through how I would set it up. | ||
Certainly! Automating the sending of daily email reports in Python involves the following steps: | ||
|
||
1. **Set up the Python environment**: Ensure necessary libraries are installed. | ||
2. **Compose the email content**: Format the report. | ||
3. **Set up the email server configuration**: Choose and configure an SMTP server. | ||
4. **Automate email sending**: Schedule the script to run daily. | ||
|
||
Here’s a step-by-step guide: | ||
|
||
### Step 1: Environment Setup | ||
|
||
First, we need to install the necessary libraries. We will use `smtplib` for sending emails and `email` library for constructing the email content. Additionally, `schedule` can be used for scheduling the script to run daily. | ||
|
||
Install the `schedule` library using pip: | ||
|
||
```bash | ||
pip install schedule | ||
``` | ||
|
||
### Step 2: Compose the Email | ||
|
||
We will create a function to compose the email content. This function can be modified to include any data or report content you need. | ||
|
||
### Step 3: Email Server Configuration | ||
|
||
We will set up SMTP server configuration (example using Gmail). | ||
|
||
### Step 4: Automate Email Sending | ||
|
||
We will use the `schedule` library to run the script daily. | ||
|
||
Here’s the complete script: | ||
|
||
```python | ||
import smtplib | ||
from email.mime.multipart import MIMEMultipart | ||
from email.mime.text import MIMEText | ||
import schedule | ||
import time | ||
|
||
# Function to send email | ||
def send_email(): | ||
# Email configuration | ||
sender_email = "[email protected]" | ||
receiver_email = "[email protected]" | ||
password = "your_password" | ||
|
||
# Create the email content | ||
msg = MIMEMultipart() | ||
msg['From'] = sender_email | ||
msg['To'] = receiver_email | ||
msg['Subject'] = "Daily Report" | ||
|
||
# Body of the email | ||
body = "This is your daily report." | ||
msg.attach(MIMEText(body, 'plain')) | ||
|
||
try: | ||
# Setting up the SMTP server | ||
server = smtplib.SMTP('smtp.gmail.com', 587) | ||
server.starttls() | ||
server.login(sender_email, password) | ||
text = msg.as_string() | ||
server.sendmail(sender_email, receiver_email, text) | ||
server.quit() | ||
print("Email sent successfully!") | ||
except Exception as e: | ||
print(f"Failed to send email: {e}") | ||
|
||
# Schedule the email to be sent every day at a specific time | ||
schedule.every().day.at("08:00").do(send_email) | ||
|
||
print("Scheduler started. Waiting to send email...") | ||
|
||
# Keep the script running | ||
while True: | ||
schedule.run_pending() | ||
time.sleep(60) | ||
``` | ||
|
||
### Detailed Setup Guide | ||
|
||
1. **Install Required Libraries**: | ||
Ensure you have the `schedule` library installed: | ||
```bash | ||
pip install schedule | ||
``` | ||
|
||
2. **Modify Email Configuration**: | ||
- Replace `[email protected]` with your email address. | ||
- Replace `[email protected]` with the recipient's email address. | ||
- Replace `your_password` with your email account password. | ||
*Note*: Using an email account password directly in the script is not secure. Consider using environment variables or app-specific passwords. | ||
|
||
3. **Customize the Email Content**: | ||
- Modify the `body` variable to include the content of the daily report. | ||
|
||
4. **SMTP Server Configuration**: | ||
- The script uses Gmail’s SMTP server (`smtp.gmail.com`). | ||
- Ensure "Less secure app access" is enabled in your Google account settings, or use an App Password if 2FA is enabled. | ||
|
||
5. **Schedule the Script**: | ||
- The script is set to run daily at 08:00 AM (`schedule.every().day.at("08:00").do(send_email)`). | ||
- Adjust the time as needed. | ||
|
||
6. **Run the Script**: | ||
- Execute the script and keep it running. It will send the email daily at the scheduled time. | ||
- To run the script in the background or as a service, consider using tools like `nohup` or creating a systemd service on Linux. | ||
|
||
### Security Note | ||
|
||
For security reasons, avoid hardcoding sensitive information like passwords in your script. Use environment variables or secure storage solutions. | ||
|
||
By following these steps, you should be able to automate the sending of daily email reports using Python. If you have any specific requirements or additional features to add, feel free to ask! | ||
|
||
Total Tokens: 2297 | ||
Total Cost: $0.032010 | ||
|
||
----- | ||
|
||
CONTEXT: Below is a summary of the conversation between the User -- a Human -- and an AI Assistant (yourself). INSTRUCTION: The User will send a message/prompt with the expectation that you will pick up where you left off and seamlessly continue the conversation. Do not give any indication that the conversation had paused or resumed; simply answer the User's next query in the context of the above Chat, inferring the Context and asking for additional information if necessary. | ||
--- | ||
Conversation Summary: In this conversation, the user requests assistance in automating the sending of daily email reports with a Python script. The AI assistant provides a comprehensive step-by-step guide on environment setup, composing the email, configuring the email server, and automating the email sending process. It includes details on installing necessary libraries, setting up the email content, configuring an SMTP server, and scheduling the script to run daily. Additional information on customizing the script, modifying email configurations, and ensuring security best practices are also covered, giving a thorough walkthrough for setting up the automated email reports system in Python. |
Oops, something went wrong.