Project

Simple Python CLI Chat

Easy
122 completions
~ 5 hours
4.4

Learn about the basics of OpenAI API and chat completions API, and how to send and receive messages and call functions with GPT.

Provided by

JetBrains Academy JetBrains Academy

About

Get started with OpenAI's Chat Completion API by implementing it in a Python CLI program. Create a CLI assistant with whom you can chat.

Training project icon

Training project

This project allows you to practice and strengthen your coding skills, helping you get ready for more advanced tasks ahead.

What you'll learn

Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
Read input from the console, send it to GPT, and calculate the token cost.
Make the program continue and make the assistant call the function to end the program.

Reviews

Abdullah Abdel-khalek avatar
Abdullah Abdel-khalek
4 weeks ago
I think this project was a nice way of going over the basics, especially the part where you needed to end the conversation if the user indicates it. This requires both giving the LLM the ability to reason and call a tool that will actually break the code.
Frank Vreys avatar
Frank Vreys
3 months ago
Stage 1 & 2 are rather straightforward.Stage 3 was difficult. It takes a while before I realised to do a functional call to the model to collect the call ID.
Anushka Weerasooriya avatar
Anushka Weerasooriya
6 months ago
Good intro project into LLMs with ample opportunity for playing around with the OpenAI Python SDK. The project was based on the Chat Completions API though the Responses API is now preferred. That said, the former has better compatibility with other LLM providers.

4.4

Learners who completed this project within the Introduction to AI Engineering with Python course rated it as follows:
Usefulness
4.7
Fun
4.4
Clarity
4.2