AI for ECE

Lecture 103

Practical AI

Call an AI model from Python. Memory, system prompt, tools. Build a chat app and an AI to-do app.

01

Slides

Lecture 103Practical AIAI for ECE1 / 64

In these slides

  1. A quick refresher of 101 and 102
  2. Use AI, or build AI into your own app
  3. One API call: provider, key, endpoint, model
  4. The messages list, roles and the JSON reply
  5. Memory is a list. The system prompt gives the model a job
  6. Tools, a chat app and an AI to-do app
Open slides 64 slides · new tab · arrow keys to move
02

Before you start

One timeSet up Python on your laptopPython, VS Code, a terminal and a virtual environment. Windows, macOS and Linux. ~30 min

Done it in an earlier lecture? Skip this. Go to the exercises.

03

Exercises

1 exercise
  1. Exercise103.1ECE study buddyGet a free key. Then ask ECE questions from Python. Add a system prompt, a loop and a memory.You build A terminal chat helper that answers ECE questions and remembers the chat 45 minBeginner
04

Code from the lecture