What is the prompt to download all prompts entered by me along with result provided CHAT GPT as a PDF Document

What is the prompt to download all prompts entered by me along with result provided CHAT GPT as a PDF Document

Hi @yogesh4 :wave:

Welcome :people_hugging: to the community!

You can use the following prompt, but it’s compatible with GPT-4 and GPT-4o versions that have the Code Interpreter and Data Analysis tools for running Python code and saving files.

Also, you might find some Chrome extensions, like FancyGPT, useful for downloading your chats as PDF or TXT.

Please save all my prompts (without your responses) from this session into a PDF file. You can use the following Python code to generate the PDF:

```python
from fpdf import FPDF

# Function to collect and save user prompts as PDF
def save_prompts_to_pdf(user_prompts, output_file_path="User_Prompts.pdf"):
    pdf = FPDF()
    pdf.set_auto_page_break(auto=True, margin=15)
    
    # Add a page
    pdf.add_page()

    # Set title
    pdf.set_font("Arial", 'B', 16)
    pdf.cell(200, 10, txt="User Prompts Only", ln=True, align='C')

    # Set content
    pdf.set_font("Arial", size=12)
    
    # Add the user prompts to the PDF
    for i, prompt in enumerate(user_prompts, start=1):
        pdf.multi_cell(0, 10, f"{i}. User: {prompt}")

    # Save the PDF to a file
    pdf.output(output_file_path)
    return output_file_path

# Example usage:
user_prompts = [
    "What is the weather forecast for tomorrow in New York City?",
    "Can you explain the theory of relativity in simple terms?",
    "What are the best practices for securing a cloud database?",
    "Please create a PDF with all my prompts (excluding your responses) from the beginning of our conversation."
]

# Call the function to save the prompts to PDF
save_prompts_to_pdf(user_prompts, "User_Prompts_All.pdf")

Chat History

PDF

1 Like