📺 FUNCTION CALLING with LLMs and PYTHON (ITALIAN QWEN3 TOOL CALLING TUTORIAL)
Thanks to function calling, we can "have" our language models execute external functions we've written, thus overcoming the intrinsic limitations of the models themselves and having them perform concrete actions in the real world, such as retrieving the system time or anything else we can think of. The interaction between the language model and Python code will be completely hidden from the user, who can continue to communicate with the model via natural language chat, without any difference from a "classic" chat.
In the video, we'll use the open-weight Qwen3 4B model, but the technique illustrated is also applicable to other LLMs!
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
VIDEO CHAPTERS:
00:00 Intro to function calling
02:00 Running Qwen 3 via LM Studio
02:59 Function calling via prompting
05:20 Explanation of test functions
08:46 OpenAI SDK (chat completions)
01:42 Process_stream()
04:50 Chat_loop()
07:11 Tool_calls and Tool_message
09:30 Very brief notes on security
🚀 Written version and code: https://www.programmareinpython.it/bl...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
👨💻 Free Python Programming Courses https://www.programmareinpython.it/co...
🚀 Complete Python Programming and Web Development Courses https://www.programmareinpython.it/pr...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Free Newsletter: https://www.developersnewsletter.com
Telegram: https://t.me/programmareinpython
GitHub: https://www.github.com/pymike00
Twitter (X): / pymike00
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬