SlideShare a Scribd company logo
1 of 23
Generate Art w/ DALL·E 2 &&
Twilio SMS
Devs && Dumplings 2/23
Lizzie Siegle @lizziepika
● ☎️Twilio devangelist
● 👩🏻💻Bryn Mawr CompSci
● 😍 ML🤖, APIs
● ✍🏽JS, 🐍, some Swift📱,
Haskell
● ❤️ siu mai, XLB🤖, 🚴🏻♀️, 🎾, 🏃♀️
Agenda
● OpenAI/DALL·E 101
● OpenAI API
● DALL·E API calls
● Twilio Serverless Toolkit
● Using the OpenAI API w/ JS
❓🤖
● AI research + deployment company
● Create AGI
● Promote, develop “friendly” AGI
○ "benefit all of humanity"
● ChatGPT, DALLE-2
DALL·E
● OpenAI's deep learning model to make images from text
● Trained on text-image pairs
● 12 billion parameter version of GPT-3 (neural network to generate text)
OpenAI API
API examples
Codex GPT-3
OpenAI API Key @ platform.openai.com
DALL·E API
What are we building?
Twilio Serverless Toolkit
New Twilio Function project
Env Variables
Make a Twilio Function with JavaScript
3 properties in image generation API call
1. prompt: required. Text description of desired generated
image
2. n: optional. # (1-10) of images to generate. 1=default.
3. size: optional. Size of generated images. Must be
256x256, 512x512, or 1024x1024.
Deploy Twilio Serverless Function
Configure Twilio Phone # with Function
1. 📱+12407633723
2. @devsndumps
Thank you!
@lizziepika
/elizabethsiegle
✍🏽 https://twil.io/dumplings

More Related Content

Similar to Generate Art with DALL·E 2 and Twilio MMS.pptx

Open AI Chat GPT-4-3.pptx
Open AI Chat GPT-4-3.pptxOpen AI Chat GPT-4-3.pptx
Open AI Chat GPT-4-3.pptx
JKHomer
 
openaichatgpt-4-3-230403022910-5eda7251.pdf
openaichatgpt-4-3-230403022910-5eda7251.pdfopenaichatgpt-4-3-230403022910-5eda7251.pdf
openaichatgpt-4-3-230403022910-5eda7251.pdf
DavidOlivos3
 
GitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your ReposGitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your Repos
Weaveworks
 

Similar to Generate Art with DALL·E 2 and Twilio MMS.pptx (20)

PyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfPyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdf
 
Open AI Chat GPT-4-3.pptx
Open AI Chat GPT-4-3.pptxOpen AI Chat GPT-4-3.pptx
Open AI Chat GPT-4-3.pptx
 
openaichatgpt-4-3-230403022910-5eda7251.pdf
openaichatgpt-4-3-230403022910-5eda7251.pdfopenaichatgpt-4-3-230403022910-5eda7251.pdf
openaichatgpt-4-3-230403022910-5eda7251.pdf
 
Open source, What | Why | How
Open source, What | Why | How Open source, What | Why | How
Open source, What | Why | How
 
Unleashing the Power of Generative AI.pdf
Unleashing the Power of Generative AI.pdfUnleashing the Power of Generative AI.pdf
Unleashing the Power of Generative AI.pdf
 
INTERFACE, by apidays - Building an Accessible API Spec
INTERFACE, by apidays - Building an Accessible API SpecINTERFACE, by apidays - Building an Accessible API Spec
INTERFACE, by apidays - Building an Accessible API Spec
 
GitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your ReposGitOps Core Concepts & Ways of Structuring Your Repos
GitOps Core Concepts & Ways of Structuring Your Repos
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
 
Iotivity atmel-20150328rzr
Iotivity atmel-20150328rzrIotivity atmel-20150328rzr
Iotivity atmel-20150328rzr
 
X tuple open erp system
X tuple open erp system X tuple open erp system
X tuple open erp system
 
Android lollipop for developers
Android lollipop for developersAndroid lollipop for developers
Android lollipop for developers
 
Desenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDesenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos android
 
Implementing OpenCL support in GEGL and GIMP
Implementing OpenCL support in GEGL and GIMPImplementing OpenCL support in GEGL and GIMP
Implementing OpenCL support in GEGL and GIMP
 
Goodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social UpdateGoodle Developer Days London 2008 - Open Social Update
Goodle Developer Days London 2008 - Open Social Update
 
Ecosystem WG
Ecosystem WGEcosystem WG
Ecosystem WG
 
openai-chatgpt sunumu
openai-chatgpt sunumuopenai-chatgpt sunumu
openai-chatgpt sunumu
 
Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net Developer
 
DWX 2013 Nuremberg
DWX 2013 NurembergDWX 2013 Nuremberg
DWX 2013 Nuremberg
 
Info Session GDSC USICT
Info Session GDSC USICTInfo Session GDSC USICT
Info Session GDSC USICT
 

More from Elizabeth (Lizzie) Siegle

More from Elizabeth (Lizzie) Siegle (20)

PyBay23: Understanding LangChain Agents and Tools with Twilio (or with SMS)....
PyBay23:  Understanding LangChain Agents and Tools with Twilio (or with SMS)....PyBay23:  Understanding LangChain Agents and Tools with Twilio (or with SMS)....
PyBay23: Understanding LangChain Agents and Tools with Twilio (or with SMS)....
 
Intro to Text Classification with TensorFlow
Intro to Text Classification with TensorFlowIntro to Text Classification with TensorFlow
Intro to Text Classification with TensorFlow
 
Segment Data Analytics for Indie Developers: KCDC 2023
Segment Data Analytics for Indie Developers: KCDC 2023Segment Data Analytics for Indie Developers: KCDC 2023
Segment Data Analytics for Indie Developers: KCDC 2023
 
Refactr.tech.pptx
Refactr.tech.pptxRefactr.tech.pptx
Refactr.tech.pptx
 
AthenaHacks Keynote 2023
AthenaHacks Keynote 2023AthenaHacks Keynote 2023
AthenaHacks Keynote 2023
 
Build a Chatbot with TensorFlow.js and Twilio
Build a Chatbot with TensorFlow.js and TwilioBuild a Chatbot with TensorFlow.js and Twilio
Build a Chatbot with TensorFlow.js and Twilio
 
Build a Chatbot with Machine Learning Webinar
Build a Chatbot with Machine Learning WebinarBuild a Chatbot with Machine Learning Webinar
Build a Chatbot with Machine Learning Webinar
 
Build an AI/ML Chatbot Workshop
Build an AI/ML Chatbot WorkshopBuild an AI/ML Chatbot Workshop
Build an AI/ML Chatbot Workshop
 
Improve Communication Apps with Machine Learning
Improve Communication Apps with Machine LearningImprove Communication Apps with Machine Learning
Improve Communication Apps with Machine Learning
 
Autopilot workshop for Brazil Hackathon 4/2020
Autopilot workshop for Brazil Hackathon 4/2020Autopilot workshop for Brazil Hackathon 4/2020
Autopilot workshop for Brazil Hackathon 4/2020
 
Train to Tame: Improve Communications Apps with TensorFlow
Train to Tame: Improve Communications Apps with TensorFlowTrain to Tame: Improve Communications Apps with TensorFlow
Train to Tame: Improve Communications Apps with TensorFlow
 
Design Considerations for Building Better Bots x How Build a Facebook Messeng...
Design Considerations for Building Better Bots x How Build a Facebook Messeng...Design Considerations for Building Better Bots x How Build a Facebook Messeng...
Design Considerations for Building Better Bots x How Build a Facebook Messeng...
 
VoiceHacks 2019
VoiceHacks 2019VoiceHacks 2019
VoiceHacks 2019
 
Intro to AI and CoreML in Swift: Hear + Now 2019
Intro to AI and CoreML in Swift: Hear + Now 2019Intro to AI and CoreML in Swift: Hear + Now 2019
Intro to AI and CoreML in Swift: Hear + Now 2019
 
Git Fetch Coffee: Thoughts on Early in Career Developer Relations
Git Fetch Coffee: Thoughts on Early in Career Developer RelationsGit Fetch Coffee: Thoughts on Early in Career Developer Relations
Git Fetch Coffee: Thoughts on Early in Career Developer Relations
 
Chatbots & Voice Assistants London March 2019
Chatbots & Voice Assistants London March 2019Chatbots & Voice Assistants London March 2019
Chatbots & Voice Assistants London March 2019
 
iOSCon 2019: Generate a Song from Markov Models in Swift
iOSCon 2019: Generate a Song from Markov Models in SwiftiOSCon 2019: Generate a Song from Markov Models in Swift
iOSCon 2019: Generate a Song from Markov Models in Swift
 
SF Python Holiday Party 2018
SF Python Holiday Party 2018SF Python Holiday Party 2018
SF Python Holiday Party 2018
 
Twilio Intern Final Presentation
Twilio Intern Final PresentationTwilio Intern Final Presentation
Twilio Intern Final Presentation
 
HackCon 2017:How&Why Every Hackathon Should Be Like a Women's Hackathon
HackCon 2017:How&Why Every Hackathon Should Be Like a Women's HackathonHackCon 2017:How&Why Every Hackathon Should Be Like a Women's Hackathon
HackCon 2017:How&Why Every Hackathon Should Be Like a Women's Hackathon
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Generate Art with DALL·E 2 and Twilio MMS.pptx

Editor's Notes

  1. Who here has used ChatGPT? What are some prompts you've asked it? Anyone use Dall-E or heard of Dall-E? Same…
  2. OpenAI is an AI research and deployment company. They differ from other AI companies in that they aim to promote and develop "friendly" AGI. What does that mean? AGI is artificial general intelligence, or AI that matches human intellect. Friendly AI would have a positive effect on humanity or at least align with human interests or contribute to foster the improvement of the human species. It is a part of the ethics of artificial intelligence and is closely related to machine ethics. These are pretty lofty goals! You may know them as the creators of ChatGPT. Last year, their products ChatGPT and DALLE-2 managed to take AI mainstream, and now the company is looking to make a few new friends, with Microsoft reportedly planning to pump $10 billion into the business.
  3. Here, I provide a prompt of "impressionist version of pikachu playing tennis" in the browser https://labs.openai.com/e/Adn2NE87pFTPm9oGHpmkZBuf
  4. DALL·E is a deep learning model developed and trained by OpenAI to create digital images from text captions, called "prompts". It was trained on a dataset of text-image pairs and is a 12-billion parameter version of GPT-3. GPT-3, or the third-generation Generative Pre-trained Transformer, is a neural network machine learning model trained using internet data to generate any type of text. Prompt on left: stained-glass window of toucans in space
  5. As an evangelist who makes a lot of demo apps, I have a thing for APIs–they allow developers to add different features build apps instead of building them out completely by themselves! They're like legos with code! So what can you do with the OpenAI API? You can build apps that use OpenAI's powerful models. You can access GPT-3, which performs a variety of natural language tasks. Codex, which translates natural language to code, and Dall-E, which creates and edits original images. This is one API call to the OpenAI API, using the davinci language model to make a list of astronomical observatories.
  6. GitHub Copilot is an AI pair programmer that helps you write code faster with less work. Using Codex, GitHub Copilot applies the context in your editor and synthesizes whole lines and even entire functions of code. Duolingo uses GPT-3 to correct French grammar. An internal Duolingo study shows that use of this feature leads to measurably better second language writing skills!
  7. Get an API Key here in the console at platform.openai.com People say it's pricey to use, but my bill was not that bad last month??? And I used it quite a bit for some tutorials and I shared the phone #s out to encourage usage, so I wonder if I'm missing something. Anyhoo…
  8. Developers can now integrate DALL·E directly into their apps and products through our API. This curl request to the API (using an OpenAI API key, unique to you!) (which sets the size, n is the # of images to generate) will generate this image given the prompt "a photo of a happy corgi puppy sitting and facing forward, studio light, longshot":
  9. So we did that with a curl request to the OpenAI API, and previously we saw images generated from a text prompt in the browser. Hmm. What's another medium we could do this from?
  10. How about we do that via text message?
  11. The Serverless Toolkit is CLI tooling that helps you develop Twilio Functions locally and deploy them to Twilio Serverless Functions, because why spin up and host your own server when Twilio will do it for you? The best way to work with the Serverless Toolkit is through the Twilio CLI, which can be installed by running these commands on the command line to install it and the Serverless Toolkit
  12. Afterwards, we create a new project called dalle-img-generation-sms and install our lone requirement openai:
  13. Open up your .env file in your Functions project root directory and add this line so our JS code can access the OpenAI API key while keeping it a secret. I have a friend Kevin who I interned with in 2016… Anyways. Now in our JavaScript Twilio Function code, we can access that API key with the context.openai_api_key variable
  14. In the /functions directory we make a new file called dalle.js containing this code which makes an async function that will handle incoming text messages. The function Creates a Configuration object (from the openai package) passing in an object containing the apiKey property. Creates an OpenAIApi object passing in the configuration. Retrieves the body of the incoming message and stores it in the inbMsg variable. Calls the openai.createImage function to use one of their language models to generate an image based on the inbMsg prompt. We get the image URL we need to send an image using Twilio. Creates a Twilio Messaging Response object which responds with some text and media pointing to the image generated by DALL·E 2. This twiml is passed into the callback function which will write it to the HTTP response.
  15. In order to specify your image generation, you need to pass in a configuration object containing three properties: prompt, n, and size. prompt is the only required property, representing a text description of the desired generated image. n is an optional property that defaults to one. It's the number of images to generate and must be between one and ten. Lastly, the optional size property is the size of the generated images and must be either 256x256, 512x512, or 1024x1024.
  16. To deploy your app to Twilio, run twilio serverless:deploy from the root directory. You should see the URL of your Function at the bottom of your terminal:
  17. Using the Twilio CLI, you can update the phone number using the Phone Number SID of your Twilio phone number. You can see it in the Twilio Console under Properties and it begins with "PN". (click) (click) If you don't wish to configure your Twilio phone number using the Twilio CLI, you can grab the Function URL corresponding to your app (the one that ends with /dalle) and configure a Twilio phone number with it. You'd select the Twilio number you just purchased in your Twilio Phone Numbers console and scroll down to the Messaging section as shown here. Paste the link in the text field for A MESSAGE COMES IN webhook making sure that it's set to HTTP POST. When you click Save, it should look like this! The Service is the Serverless project name, environment provides no other options, and Function Path is the file name. Now take out your phone and text a question or prompt to your Twilio number.