Wednesday, December 25, 2024

Delphi and AI [3]: The meaning of Christmas

It's the time of the year to be merry and have fun, so no code today!

I've decided to ask our future AI overlords about the meaning of Christmas. The Delphi way, of course!

Today I'm posting just the answer I liked the most. You can read the others on GitHub.

Happy holidays, fellow programmers! And remember - Delphi, it is the way!

Happy holidays!
As befits an article on AI-generated content, the image was created by Midjourney.

Tuesday, December 17, 2024

Delphi and AI [Intermission]: Introducing Chatterbox

t’s great that Embarcadero has added an AI Chat window to RAD Studio, but let’s be honest—the implementation is lacking. As one participant at a recent workshop noted: “It looks like someone wrote it two hours before the release.” Sadly, I have to agree. The AI Chat feature is practically useless if you intend to use AI for anything more than a quick demo.

That’s when I started considering better ways to interface with LLMs. Instead of searching for an alternative, I decided to build my own AI chat interface. It’s called Chatterbox, and it’s fully open source. You can find it on GitHub under a “do with it (almost) whatever you want” license.

To start using Chatterbox, you can either build it from source or download the precompiled EXE from GitHub (currently available only for Windows 32-bit). The app is written with FireMonkey, so—at least theoretically—it can also be built for macOS, iOS, Android, and Linux. However, I haven’t tested it on platforms other than Windows.

To build Chatterbox, you’ll need the following libraries: Spring4D, DCPCrypt2, and TAES. Links to these dependencies are included in the README file.

Wednesday, December 11, 2024

Delphi and AI [2]: Clipboard Monitor

While preparing for my Delphi and AI workshop, I decided to keep a log of all my interactions with AI helpers in a file for later analysis. Initially, I searched for an existing utility to log clipboard changes to a file (and I found one), but then I thought—why not ask the AI helpers to help me create one? After all, it’s not a big problem: set up a timer, check if the clipboard content changes, and log the content to a file. What could be simpler?

I posed the same question to all five engines:

"I want to create a Delphi application that would monitor clipboard content (on Windows) and append clipboard content to a log file each time the clipboard has changed (and has a text inside)."

Let's see how they performed!

Logs and code are available here.

Saturday, December 07, 2024

Delphi and AI

Recently, I led a workshop in Slovenia where we explored the current state of AI in relation to Delphi programming. (A note to participants: the slides are finally online—apologies for the delay!) The initial results were, let’s say, interesting enough to warrant further study.

Now, let’s see how today’s "state-of-the-art" AIs perform with Delphi programming!

The contenders are:

  • OpenAI with the o1-mini model (my testing suggests that it gives better results than chatgpt-4o)
  • Ollama with codellama:13b model (the largest model I can run on my NVidia 4090)
  • Gemini with gemini-pro (currently pointing to gemini-1.5-pro)
  • Claude with claude-3-5-sonnet-latest (at this moment this resolves to claude-3-5-sonnet-20241022)
As I care for the privacy of the code I send to these tools, I'm using a paid version of Gemini.

These four engines I'll be using directly from the RAD Studio, most of the time through the "AI Chat" panel. 

When the privacy wouldn't be a concern, I'll also be using:
  • CoPilot via Microsoft Edge (I use it a lot and I like it for general-purpose questions with googlable answers)
All chat logs will be published on GitHub

Tuesday, November 19, 2024

RAD Studio 12.2 and AI helpers

This is an invitation to the workshop in Ljubljana next week. As the session will be in Slovenian language, so is this invitation ...

Odkar smo se nazadnje srečali, je minilo kar nekaj časa. Medtem je izšla nova različica RAD Studio 12.2. Ta med drugim prinaša novost, ki smo jo vsi čakali - integracijo umetne inteligence.

Pridružite se nam na delavnici, kjer bomo predstavili  novosti v RAD Studiu 12.2.,podporne sisteme ChatGPTGemini, Claude in Ollama ter skušali ugotoviti, ali so že dovolj napredni, da jih lahko Delphi programerji uporabljajo pri svojem delu.

Poigrali se bomo z računalniškimi pomočniki in preizkusili vaše ideje o uporabi teh orodij. 

Vidimo se v sredo, 27. 11., ob 9.30 v prostorih OOZ Vič, Tržaška cesta 207, Ljubljana!

Klikni za prijavo!

Friday, April 05, 2024

Delphi and Python, working happily together

Next Wednesday, 10th, I'll be talking about Delphi and Pyhon in Ljubljana. As usual for Slovenian workshops, the talk will be in Slovenian language so I'll continue this invitation appropriately ...

Python je izjemno priljubljen programski jezik, ki slovi po svoji raznoliki in preprosti uporabi. Skupnost razvijalcev nenehno prispeva k njegovemu razvoju in izboljšanju jezika, kar dodatno krepi njegovo privlačnost za širok nabor uporabnikov. Kot večina večplatformnih sistemov pa ne slovi po podpori za izdelavo uporabniških vmesnikov. 

Tu nastopi Delphi, ki slovi po svoji hitrosti in učinkovitosti in je odličen za razvoj aplikacij za Windows okolje. Zato ni presenetljivo, da okolji ne delujeta kot neposredna konkurenca, pač pa se izredno dobro dopolnjujeta

Največja prednost je združevanje moči obeh jezikov. Delphi ponuja hitrost in zmogljivost, Python pa berljivost in obsežno knjižnico razširitev. S tem lahko razvijalci izkoristite najboljše iz obeh svetov.

Na predavanju si bomo ogledali: 

  • Kako lahko Python in Delphi sodelujeta na dva različna načina, 
  • predstavili bomo orodji DelphiVCL in DelphiFMX, s katerima lahko v Pythonu enostavno ustvarite lep uporabniški vmesnik 
  • ter nekaj orodij (Python4Delphi, PythonEnvironments, Lightweight Python Wrappers), ki omogočajo, da kodo, napisano v Pythonu, vgradite v svoj Delphi program. 

Spotoma si bomo na kratko ogledali še novosti v novem Delphi 12.1!

Kliknite za prijavo!