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