Forums

Please or Register to create posts and topics.

Copy Media filenames to captions #media #AI

I prompted Gemini to generate this statement, reacting to this post in the RM Community: (edited to correct a misdirection in my prompt that misnamed the MediaFile column)

UPDATE MultiMediaTable
SET
Caption = CASE
WHEN Caption IS NULL OR Caption = '' THEN '{' || MediaFile || '}'
ELSE Caption || ' {' || MediaFile || '}'
END,
UTCModDate = julianday('now') - 2415018.5
WHERE MediaFile IS NOT NULL
AND MediaFile != ''
AND (Caption IS NULL OR Caption NOT LIKE '%' || MediaFile || '%');

Her question was for image-type files but this script does not discriminate because, iirc, the RM UI Gallery can list captions for non-media types. The query appends the current filename to the Caption without deleting any different former filename if it has been changed thus building a trail of filename changes for the file if it is run repeatedly.

I continue to be impressed at how much Gemini now knows about the RM11 database structure and lineage-linked genealogy data structures in general. I gave it a very skimpy prompt (to see how well it would respond was a motive in responding to Peggy's inquiry). I did not tell it to test for both NULL and empty string conditions in Caption nor to pad the '{filename}' with a leading space character if the Caption already had content. My simple instruction to add an update to UTCModDate resulted in the correct offset from system time. The braces {...} were my request.

Do you suppose that someday we might find an AI assistant integrated in the RM app? Does anyone know of a family tree app that already has?

I actually communicated with Peggy offline and gave her a script. Based on the K.I.S.S. principle, my script was not as thorough as the one developed by Gemini, but it met her needs which was what was important. She had no existing captions, and the only thing she cared about other than fully replacing the caption with the file name was not to include the .jpg extension in the caption.

I have been working extensively with AI, both on SQLite and on C++. My experience is that AI can be extremely impressive for the most part, but can still be extremely dumb at times. My biggest problem with using it for SQLite is that if I ask it for a minor tweak to a script it just completed for me, it simply doesn't understand the concept of a minor tweak. Rather, it does the script over from scratch, and unless I re-specify all the specs again I may lose some of the original specs.

I have used AI in particular for complicated recursive CTE's. With such scripts, it sometimes will produce a script that will not even run. It will then make a minor tweak that still will not run, promising me that this one will run for sure. Then I will go through that cycle several more times until it returns to the original script that still will not run. It doesn't seem to realize that it has returned to its original script that would not run.

That being said, it can be incredibly impressive, especially in its knowledge of the RM schema. And further to what Tom said, I really wish RM would be willing to leverage the fact that RM is based on SQLite to give users a better (and supported) way to to run SQLite scripts safely for things like copying file names to captions, and dozens if not hundreds of simple applications of the kinds of things SQLite can do.

Tom Holden and thf have reacted to this post.
Tom Holdenthf