ChatGPT and LiveCode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: ChatGPT and LiveCode
Hi,
A video series is an interesting idea. So...I asked my GPT buddy what it thought and it gave me the attached outline as a downloadable pdf. I asked it specifically to concentrate on workflow and not on learning LiveCode basics. I can have the GPT expand any or all sections and create scripts for the YouTube videos.
I am interested on any feedback on the attached outline.
I don't have experience creating YouTube videos but there are a few LiveCode YouTube videos that I think are well done that use screen captures. I might take a stab at this if I can create a quality product. Since I have archived all of my chats since I signed up for ChatGPT Plus, I have plenty of original material.
- Mike and my GPT buddy (I need a name..."Robo-Klaus"?)
A video series is an interesting idea. So...I asked my GPT buddy what it thought and it gave me the attached outline as a downloadable pdf. I asked it specifically to concentrate on workflow and not on learning LiveCode basics. I can have the GPT expand any or all sections and create scripts for the YouTube videos.
I am interested on any feedback on the attached outline.
I don't have experience creating YouTube videos but there are a few LiveCode YouTube videos that I think are well done that use screen captures. I might take a stab at this if I can create a quality product. Since I have archived all of my chats since I signed up for ChatGPT Plus, I have plenty of original material.
- Mike and my GPT buddy (I need a name..."Robo-Klaus"?)
- Attachments
-
- ChatGPT_LiveCode_Video_Series_Outline.pdf.zip
- (3.44 KiB) Downloaded 43 times
Mike Roberts
https://mygiantbrain.com
https://mygiantbrain.com
Re: ChatGPT and LiveCode
Your PDF looks fine, that would be a great starting point.
Video captures are all you need and someone that can speak well on top of the video captures and engage audiences. Not everyone can do this well, and it is a key ingredient. If you feel hesitant about this I'm sure there are those who would volunteer.
The worst YouTube stuff I've seen are videos where someone plays back a video capture (often accelerated) with no VoiceOver at all, silence or sometimes text. These are much less engaging. Goes without saying, even with voiceovers you would need to be handy with video editing. Segments could be 3-5 minutes long, or at most 10 min (I would avoid 45 minute or longer segments as interest will wane).
Not sure if it's worth approaching LiveCode directly to get some support with this, as it would be a great promotional tool for them as well. Worst case scenario, they can only say 'No' if you email support at livecode dot com.
Done well, this is something that can be pushed to social media etc, which would be in LC Ltd's interest, could be post on their blog etc.
Video captures are all you need and someone that can speak well on top of the video captures and engage audiences. Not everyone can do this well, and it is a key ingredient. If you feel hesitant about this I'm sure there are those who would volunteer.
The worst YouTube stuff I've seen are videos where someone plays back a video capture (often accelerated) with no VoiceOver at all, silence or sometimes text. These are much less engaging. Goes without saying, even with voiceovers you would need to be handy with video editing. Segments could be 3-5 minutes long, or at most 10 min (I would avoid 45 minute or longer segments as interest will wane).
Not sure if it's worth approaching LiveCode directly to get some support with this, as it would be a great promotional tool for them as well. Worst case scenario, they can only say 'No' if you email support at livecode dot com.
Done well, this is something that can be pushed to social media etc, which would be in LC Ltd's interest, could be post on their blog etc.
Re: ChatGPT and LiveCode
Thanks for the feedback.
I like the idea of the shorter segments < 10 minutes and I agree VoiceOver is necessary. I think I have a few ways to do this. I'll work on a sample video and see if this is in my wheel house and how much time needs to be invested.
If I miraculously create something half-decent I will probably post it to my website initially to get feedback and only upload to YouTube when it is ready for primetime.
-Mike
I like the idea of the shorter segments < 10 minutes and I agree VoiceOver is necessary. I think I have a few ways to do this. I'll work on a sample video and see if this is in my wheel house and how much time needs to be invested.
If I miraculously create something half-decent I will probably post it to my website initially to get feedback and only upload to YouTube when it is ready for primetime.
-Mike
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: ChatGPT and LiveCode
For anyone interested. I have set up a topic related to using LiveCode with AI.
See 'Learn AI and Contribute Topic'.
See 'Learn AI and Contribute Topic'.
Re: ChatGPT and LiveCode
Hello.
I am using the following code to get ChatGPT answers in LC10.
But I alway get the following response, even if not having previous API request:
Thanks Trevix
I am using the following code to get ChatGPT answers in LC10.
Code: Select all
on mouseUp pMouseButton
put "https://api.openai.com/v1/chat/completions" into tURL
put "XXXXXXXXXXXXXXXXX" into tKey --put here your token
put "Content-Type: application/json;charset=utf-8" & return into tHeader
put "Authorization: Bearer " & tKey & return after tHeader
set the httpHeaders to tHeader
put "gpt-3.5-turbo" into tModel
put "user" into tRole
put fld"Question" into tContent
put merge("{""e&"role""e&": ""e&"[[tRole]]""e&", "& \
quote&"content""e&": ""e&"[[tContent]]""e&"}") into tMessage
put merge("{ ""e&"model""e&": ""e&"[[tModel]]""e&","& \
quote&"messages""e&": [ [[tMessage]] ], ""e&"temperature"& \
quote&": 1, ""e&"max_tokens""e&": 256, ""e&"top_p""e&": 1, "& \
quote&"frequency_penalty""e&": 0, ""e&"presence_penalty""e&": 0 }") into tPayload
post tPayload to url tURL
put textDecode(it,"UTF-8") into it
put jsonimport(it) into tArray
if "error" is in the keys of tArray then
put tArray["error"]["message"] into fld "answer"
else
put tArray["choices"][1]["message"]["content"] into BotAnswer
put BotAnswer into fld "answer"
end if
end mouseUp
I have a free plan with ChatGPT and I think this may be the issue...can someone confirm?You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides ... api-errors.
Thanks Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: ChatGPT and LiveCode
To my suprise, it had no problem spitting out what looks to be legit code for an A* path finding algorithm, which would be useful for a simple RPG
function heuristicCostEstimate pStartNode, pEndNode
-- Calculate the heuristic cost estimate using Manhattan distance
return abs(pEndNode["x"] - pStartNode["x"]) + abs(pEndNode["y"] - pStartNode["y"])
end heuristicCostEstimate
function reconstructPath pCameFrom, pCurrentNode
-- Reconstruct the path from start to end based on the cameFrom list
put empty into tPath
put pCurrentNode into tNode
repeat until tNode is empty
put tNode & cr after tPath
put pCameFrom[tNode] into tNode
end repeat
return reverseLines(tPath)
end reconstructPath
on AStarPathfinding pStartNode, pEndNode, pGraph
-- Initialize open and closed lists
put empty into tOpenSet
put empty into tClosedSet
put pStartNode into tOpenSet
-- Initialize cameFrom and gScore dictionaries
put empty into tCameFrom
put empty into tGScore
put 0 into tGScore[pStartNode]
-- Initialize fScore dictionary with heuristic cost estimate
put heuristicCostEstimate(pStartNode, pEndNode) into tFScore
put tFScore into tFScore[pStartNode]
-- Loop until open set is empty
repeat until tOpenSet is empty
-- Find the node in open set with lowest fScore
put empty into tCurrentNode
put infinity into tLowestFScore
repeat for each line tNode in tOpenSet
if tFScore[tNode] < tLowestFScore then
put tNode into tCurrentNode
put tFScore[tNode] into tLowestFScore
end if
end repeat
-- If current node is the end node, reconstruct and return the path
if tCurrentNode = pEndNode then
return reconstructPath(tCameFrom, tCurrentNode)
end if
-- Move current node from open set to closed set
delete line tOpenSet[tCurrentNode] of tOpenSet
put tCurrentNode & cr after tClosedSet
-- Explore neighbors of current node
repeat for each key tNeighborNode in pGraph[tCurrentNode]
if tNeighborNode is among the lines of tClosedSet then
next repeat
end if
-- Calculate tentative gScore
put tGScore[tCurrentNode] + pGraph[tCurrentNode][tNeighborNode] into tTentativeGScore
-- Add neighbor node to open set if not already there
if tNeighborNode is not among the lines of tOpenSet then
put tNeighborNode & cr after tOpenSet
elseif tTentativeGScore >= tGScore[tNeighborNode] then
next repeat
end if
-- Record the best path so far
put tCurrentNode into tCameFrom[tNeighborNode]
put tTentativeGScore into tGScore[tNeighborNode]
put tTentativeGScore + heuristicCostEstimate(tNeighborNode, pEndNode) into tFScore[tNeighborNode]
end repeat
end repeat
-- No path found
return empty
end AStarPathfinding
This code defines three functions: heuristicCostEstimate, reconstructPath, and AStarPathfinding. The heuristicCostEstimate function calculates the heuristic cost estimate using Manhattan distance. The reconstructPath function reconstructs the path from the start to the end node based on the cameFrom list. Finally, the AStarPathfinding function implements the A* algorithm to find the shortest path from the start to the end node in a given graph.
You can use this code by passing the start node, end node, and the graph (represented as a dictionary where keys are nodes and values are dictionaries of neighbors with their corresponding edge costs) to the AStarPathfinding function. It will return the shortest path as a list of nodes.
Have not tested it yet, but I figured it would just say something about not knowing enough about the syntax. For sure it can do it in C or Python etc, but Livecode? I'm impressed.
function heuristicCostEstimate pStartNode, pEndNode
-- Calculate the heuristic cost estimate using Manhattan distance
return abs(pEndNode["x"] - pStartNode["x"]) + abs(pEndNode["y"] - pStartNode["y"])
end heuristicCostEstimate
function reconstructPath pCameFrom, pCurrentNode
-- Reconstruct the path from start to end based on the cameFrom list
put empty into tPath
put pCurrentNode into tNode
repeat until tNode is empty
put tNode & cr after tPath
put pCameFrom[tNode] into tNode
end repeat
return reverseLines(tPath)
end reconstructPath
on AStarPathfinding pStartNode, pEndNode, pGraph
-- Initialize open and closed lists
put empty into tOpenSet
put empty into tClosedSet
put pStartNode into tOpenSet
-- Initialize cameFrom and gScore dictionaries
put empty into tCameFrom
put empty into tGScore
put 0 into tGScore[pStartNode]
-- Initialize fScore dictionary with heuristic cost estimate
put heuristicCostEstimate(pStartNode, pEndNode) into tFScore
put tFScore into tFScore[pStartNode]
-- Loop until open set is empty
repeat until tOpenSet is empty
-- Find the node in open set with lowest fScore
put empty into tCurrentNode
put infinity into tLowestFScore
repeat for each line tNode in tOpenSet
if tFScore[tNode] < tLowestFScore then
put tNode into tCurrentNode
put tFScore[tNode] into tLowestFScore
end if
end repeat
-- If current node is the end node, reconstruct and return the path
if tCurrentNode = pEndNode then
return reconstructPath(tCameFrom, tCurrentNode)
end if
-- Move current node from open set to closed set
delete line tOpenSet[tCurrentNode] of tOpenSet
put tCurrentNode & cr after tClosedSet
-- Explore neighbors of current node
repeat for each key tNeighborNode in pGraph[tCurrentNode]
if tNeighborNode is among the lines of tClosedSet then
next repeat
end if
-- Calculate tentative gScore
put tGScore[tCurrentNode] + pGraph[tCurrentNode][tNeighborNode] into tTentativeGScore
-- Add neighbor node to open set if not already there
if tNeighborNode is not among the lines of tOpenSet then
put tNeighborNode & cr after tOpenSet
elseif tTentativeGScore >= tGScore[tNeighborNode] then
next repeat
end if
-- Record the best path so far
put tCurrentNode into tCameFrom[tNeighborNode]
put tTentativeGScore into tGScore[tNeighborNode]
put tTentativeGScore + heuristicCostEstimate(tNeighborNode, pEndNode) into tFScore[tNeighborNode]
end repeat
end repeat
-- No path found
return empty
end AStarPathfinding
This code defines three functions: heuristicCostEstimate, reconstructPath, and AStarPathfinding. The heuristicCostEstimate function calculates the heuristic cost estimate using Manhattan distance. The reconstructPath function reconstructs the path from the start to the end node based on the cameFrom list. Finally, the AStarPathfinding function implements the A* algorithm to find the shortest path from the start to the end node in a given graph.
You can use this code by passing the start node, end node, and the graph (represented as a dictionary where keys are nodes and values are dictionaries of neighbors with their corresponding edge costs) to the AStarPathfinding function. It will return the shortest path as a list of nodes.
Have not tested it yet, but I figured it would just say something about not knowing enough about the syntax. For sure it can do it in C or Python etc, but Livecode? I'm impressed.
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: ChatGPT and LiveCode
No they are not. I am a LC programmer and i actually tried LC on GPT4.richmond62 wrote: ↑Tue Dec 26, 2023 10:57 amI have a funny feeling AndyP, that the last 2 posts before yours were Spam Bots.
Regards,
Paul
-
- Livecode Opensource Backer
- Posts: 9447
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: ChatGPT and LiveCode
I apologise.No they are not. I am a LC programmer and i actually tried LC on GPT4.
-
- VIP Livecode Opensource Backer
- Posts: 9853
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: ChatGPT and LiveCode
To evaluate potential bot activity, clicking an account name will being up a summary profile, with a link to the account's posting history.
mrcoollion has written more than 700 posts here, often quite good and as far as I can tell all with apparently good intention.
The Internet is overrun with bots, but let's try to avoid living out the Twilight Zone episode "The Monsters Are Due on Maple Street".
mrcoollion has written more than 700 posts here, often quite good and as far as I can tell all with apparently good intention.
The Internet is overrun with bots, but let's try to avoid living out the Twilight Zone episode "The Monsters Are Due on Maple Street".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: ChatGPT and LiveCode
What about the posting of new user TJF above?
I don't even understand what the script does, or might do if the syntax was correct.
I don't even understand what the script does, or might do if the syntax was correct.
-
- VIP Livecode Opensource Backer
- Posts: 9853
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: ChatGPT and LiveCode
Whether that relatively new account's one post is spam or not would require someone running it.
This may be a good moment for the new account to clarify their earnestness by posting an example stack illustrating how to use the code.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: ChatGPT and LiveCode
But it takes seven postings before being able to also post images, stacks etc.
Re: ChatGPT and LiveCode
OK guys perhaps it's time to dismount the paranoid pony...
Or to rephrase, I perhaps naively give reasonable posts the benefit of the doubt.
At the very least, if it is spam, then it's the most interesting and educational spam I've seen
For one thing, I learned about A* pathfinding: https://en.wikipedia.org/wiki/A*_search_algorithm
For another, I also learned about Manhattan geometry (aka taxicab geometry): https://en.wikipedia.org/wiki/Taxicab_geometry
The code provided is not perfect: one else if statement is typed elseIf and there are no local variable declarations, which I frown upon, especially in AI generated code. But otherwise the code is syntactically valid.
As to how one uses this in real terms, I too would like to learn more. The wikipedia entry clearly shows it's a pathfinding algorithm and the pseudocode posted there matches up, so I choose to presume this is a valid post. But I don't have the first Scooby on how to actually use this
Not everyone with 1 post containing advanced code is a spammer.
Or at least I hope so...
Or to rephrase, I perhaps naively give reasonable posts the benefit of the doubt.
At the very least, if it is spam, then it's the most interesting and educational spam I've seen
For one thing, I learned about A* pathfinding: https://en.wikipedia.org/wiki/A*_search_algorithm
For another, I also learned about Manhattan geometry (aka taxicab geometry): https://en.wikipedia.org/wiki/Taxicab_geometry
The code provided is not perfect: one else if statement is typed elseIf and there are no local variable declarations, which I frown upon, especially in AI generated code. But otherwise the code is syntactically valid.
As to how one uses this in real terms, I too would like to learn more. The wikipedia entry clearly shows it's a pathfinding algorithm and the pseudocode posted there matches up, so I choose to presume this is a valid post. But I don't have the first Scooby on how to actually use this
Not everyone with 1 post containing advanced code is a spammer.
Or at least I hope so...
Re: ChatGPT and LiveCode
Is it AI spambot presenting AI generated code?
"Mostly" it's valid syntax. I haven't attempted to run it, but while it might be legitimate, a "return" from a "command" (not a function) rings like a bell made from reconstituted pork products.
I truly hope that a genuine poster has tried LiveCode in ChatGPT and found it worthy to post here . But... I'm dubious that the circumstances concur.
"Mostly" it's valid syntax. I haven't attempted to run it, but while it might be legitimate, a "return" from a "command" (not a function) rings like a bell made from reconstituted pork products.
I truly hope that a genuine poster has tried LiveCode in ChatGPT and found it worthy to post here . But... I'm dubious that the circumstances concur.
Re: ChatGPT and LiveCode
I regularly but less commonly use return in commands - it puts data into the result. Maybe I'm a spambot too?
Besides, the poster isn't claiming (s)he wrote the code - quite the opposite, it's clearly stated that this is AI generated.
So how does that factor into your logic? You have decided that a poster must be a spammer because the code produced by AI has errors in it?
As mentioned I, like everyone here, cannot be certain this is isn't spam. But it's not often I'll read spam that I find interesting, so even if it is, I don't mind it.
Maybe hold onto your reconstituted pork product bell for a little while longer and perhaps wait a few days before passing immediate judgement?