Chat with R1 (with PDF attachment support)
This script allows you to:
Copy this Val and save it as an Email Val (choose Val type in top-right corner of editor)
Add your Fireworks (or openai API compatible) API key to line 8 (or use an environment variable: https://docs.val.town/reference/environment-variables/)
Copy the email address of the Val (click 3 dots in top-right > Copy > Copy email address)
Write your email, include any attachments, and send it to the Val email address. The AI will respond after a few seconds.