Exploring LiveCode Integration with AI APIs in 2025
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
benedictwinifred
- Posts: 1
- Joined: Mon Nov 10, 2025 8:05 am
- Contact:
Exploring LiveCode Integration with AI APIs in 2025
Has anyone here tried integrating LiveCode with modern AI APIs like OpenAI or Hugging Face?
I’m experimenting with creating a desktop app that uses LiveCode as the frontend and connects to an AI backend for text generation. I’m curious about best practices for handling authentication, request limits, and response parsing in LiveCode scripts.
Any insights or sample projects would be appreciated!
I’m experimenting with creating a desktop app that uses LiveCode as the frontend and connects to an AI backend for text generation. I’m curious about best practices for handling authentication, request limits, and response parsing in LiveCode scripts.
Any insights or sample projects would be appreciated!
-
ClipArtGuy
- Posts: 260
- Joined: Wed Aug 19, 2015 4:29 pm
Re: Exploring LiveCode Integration with AI APIs in 2025
I actually am just finishing up a sample stack that integrates Anthropic's Claude API and demonstrates basic text generation, conversational chat, vision (image analysis), document analysis (PDF), structured output (JSON), simulated streaming output, and advanced system prompts. You will need a claude API key. The pictured responses were using Sonnet 4.5, which is expensive. I highly recommend testing with a cheaper model like one of the haiku models.benedictwinifred wrote: ↑Mon Nov 10, 2025 8:06 amHas anyone here tried integrating LiveCode with modern AI APIs like OpenAI or Hugging Face?
Here is the complete script generated in the first screenshot, which works as-is:
Code: Select all
on mouseUp
-- Ask user to select an image file
answer file "Please select an image file:" with type "Image files|jpg,jpeg,png,gif,bmp|All files|*"
-- Check if user cancelled
if it is empty then
exit mouseUp
end if
put it into tImagePath
-- Create a new image object
create image "ImportedImage"
put it into tImageID
-- Import the image file
set the filename of image tImageID to tImagePath
-- Get the card dimensions
put the width of this card into tCardWidth
put the height of this card into tCardHeight
-- Get the original image dimensions
put the width of image tImageID into tImageWidth
put the height of image tImageID into tImageHeight
-- Check if resizing is needed
if tImageWidth > tCardWidth OR tImageHeight > tCardHeight then
-- Calculate scaling factor to fit within card (with some padding)
put tCardWidth - 40 into tMaxWidth -- 20 pixel padding on each side
put tCardHeight - 40 into tMaxHeight
put tMaxWidth / tImageWidth into tScaleX
put tMaxHeight / tImageHeight into tScaleY
-- Use the smaller scale to ensure image fits both dimensions
put min(tScaleX, tScaleY) into tScale
-- Calculate new dimensions
put round(tImageWidth * tScale) into tNewWidth
put round(tImageHeight * tScale) into tNewHeight
-- Resize the image
set the width of image tImageID to tNewWidth
set the height of image tImageID to tNewHeight
end if
-- Center the image on the card
set the loc of image tImageID to the loc of this card
end mouseUpI will upload here soon.
Re: Exploring LiveCode Integration with AI APIs in 2025
Anyone think the OP is a warm-blooded being?
Craig
Craig
-
ClipArtGuy
- Posts: 260
- Joined: Wed Aug 19, 2015 4:29 pm
Re: Exploring LiveCode Integration with AI APIs in 2025
Is it that bad over here? I didn't see any reason to not believe this was a real person? This seems like a real question that anybody might ask....
EDIT: I mean, the text could very well be AI generated, but by a person who actually would like an answer. Seems like a specific and relevant question.
Re: Exploring LiveCode Integration with AI APIs in 2025
We can only wait and see. Your reply was terrific. We will find out what or who it impressed.
Craig
Craig
Last edited by dunbarx on Fri Nov 14, 2025 3:28 pm, edited 1 time in total.
Re: Exploring LiveCode Integration with AI APIs in 2025
I think one of the (many) problems with AI is that it lacks the capacity to be impressed. The bystanders and spectators can be impressed though.
Re: Exploring LiveCode Integration with AI APIs in 2025
The OP is biding his time...
Craig
Craig
-
ClipArtGuy
- Posts: 260
- Joined: Wed Aug 19, 2015 4:29 pm
Re: Exploring LiveCode Integration with AI APIs in 2025
Regardless of OP's suspected inhumanity, here's the stack. You will need an Anthropic API key, which can be activated with as little as $5. I highly suggest using "Haiku" models while testing. Sonnet 4.5 is extremely capable, but will eat through credits, especially when analyzing large images or documents.
