AI Ustoz UZ: learn artificial intelligence in Uzbek

How programs work with artificial intelligence

Beginner level · lesson 1 · about 8 min

A chat window is convenient for asking a question and getting an answer. But when the same job has to be done hundreds of times (for example, shortening 200 texts or checking every row of a table), doing it by hand is tedious and error-prone. A program can do such work: it sends a request to the model, receives the answer and passes it on to the next step.

A program and a model usually talk through an API: the program sends a structured request (often as JSON, that is, key and value pairs) and receives a structured answer. A large language model splits text into tokens and builds its answer piece by piece, each time choosing the next suitable piece. That is why it can make mistakes in long or large-number calculations. For exact arithmetic, an ordinary program function (a tool) is usually used.

One widely used language for such programs is Python: its syntax is easy to read and it has many ready-made libraries for working with data and artificial intelligence. In this module you will learn the basics of Python and run code right on this page: nothing needs to be installed.

Remember

  • A program can automate repeated work by sending requests to a model.
  • A program and a model exchange structured data such as JSON.
  • A model can make mistakes in calculations: exact arithmetic is done by the program.

Exercise

Why is it usually better to hand exact calculations to an ordinary program function rather than to the model?

Answer and explanation
  1. The model builds its answer as text piece by piece and can make mistakes in long calculations; a function calculates exactly. (correct answer)when checkable code does the calculation and gives an exact result, reliability goes up.
  2. The model does not recognize numbers at all.the model sees numbers as text and is often right, but there is no guarantee.
  3. Programs are always smarter than the model.it is not about intelligence: it is about choosing the right tool for the type of task.

Practical task

Write down 2 repeated tasks from your daily work and mark which of them could be automated with a program.

  • I wrote down 2 tasks
  • I marked which one can be automated

Glossary

Interactive mode: search, progress and Python exercises.