Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC309 Lecture 07

CSC309 Lecture 07

Software Engineering II
Connecting Services II
(202304)

Javier Gonzalez-Sanchez

January 24, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSC 309 Software Engineering II Lecture 10: Connecting Services

    II Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
  2. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    3 What if …? Box Name 1 Name 2 Cat Car What is a Flowchart diagram? _
  3. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    10 What if …? Box Name 1 Name 2 Cat Car What is a Flowchart diagram? _
  4. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    11 We need keys String key = "XYZabc123259#$%#$Fcaskjhdux_2342445Calp";
  5. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    12 1.Go to the AccuWeather Developer website at https://developer.accuweather.com/ 1.Sign up for a free account by filling out the registration form or sign in using your existing account credentials. 2.Once you're signed in, select the "My Apps" dropdown from the top-right corner of the page and click on "Add New App". 3.Fill out the required information about your application and agree to the terms of service. Then click on "Create App". 4.Your new app will appear on the "My Apps" page. Click on your app to view your API key and copy it to use in your code. AccuWeather
  6. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    13 { "LocalObservationDateTime": "2023-04-23T00:04:0007:00", "EpochTime":1682233440, "WeatherText":"Clear", "WeatherIcon":33, "HasPrecipitation":false, "PrecipitationType":null, "IsDayTime":false, "Temperature":{ "Metric":{ "Value":11.1, "Unit":"C", "UnitType":17 }, "Imperial":{ "Value":52.0, "Unit":"F", "UnitType":18 } }, "Link":"http://www.accuweather.com/en/us/san-luis-obispo-ca/93401/current-weather/331999 } Response
  7. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    14 Java Script Object Notation (JSON) •Data is in name/value pairs •Commas separate data •Curly braces hold objects •Square brackets hold arrays JSON XML
  8. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    20 What if …? Box Name 1 Name 2 Cat Car What is a Flowchart diagram? _
  9. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    21 1.Go to the OpenAI website at https://openai.com/ and click on the "Sign Up" button in the top-right corner of the page. 2.Follow the prompts to create an account and verify your email address. 3.Once you're logged in, click on your username in the top-right corner of the page and select "Dashboard" from the drop-down menu. 4.Click on the "API Keys" tab in the dashboard menu. 5.Click on the "New API Key" button. 6.Enter a name for your API key and select the API permissions you want to grant to the key. 7.Click the "Create" button to generate your new API key. Open AI
  10. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    22 {"id":"cmpl78QWL0xfnaEHWzTuCJZhpBK3OshrR", "object":"text_completion", "created":1682242925, "model":"text-davinci-003", "choices":[{ "text":"ANSWER TEXT HERE", "index":0, "logprobs":null, "finish_reason":"stop" }], "usage":{ "prompt_tokens":1, "completion_tokens":76, "total_tokens":77 } } Response
  11. jgs

  12. jgs CSC 309 Software Engineering II Lab 10: Work in

    your Sprint Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
  13. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    30 Make It Work Box Name 1 Name 2 Cat Car What is a Flowchart diagram? _
  14. jgs CSC 309 Software Engineering II Javier Gonzalez-Sanchez, Ph.D. [email protected]

    Winter 2023 Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly. They cannot be distributed or used for another purpose.