Jump to content

Artificial Intelligence : a way to teach Autoit to AI? - (Moved)


Recommended Posts

Hi,

I am trying to work with an artificial intelligence to help me write faster some scrpits. Here is the website https://chat.openai.com/chat

apparently it's a pretty fast learning machine but it seems to make basic mistakes. 

Please note that I don't need help to wite the code it self. I'm just trying some basics tests wit AI and it fells it.

So let's say I ask "write me an autoit script that converts a csv file into a 2d array and display the array. Here is the path of the csv file "C:\Users\Utilisateur\Downloads\ here is the name of the csv file 20221229.csv"

It will give e the following code : 

#################

# Read the CSV file into a string
$fileContents = FileRead("C:\Users\Utilisateur\Downloads\20221229.csv")

# Split the string into lines
$lines = StringSplit($fileContents, @LF)

# Initialize the 2D array
$csvData = []

# Iterate through each line
For $i = 0 To UBound($lines) - 1
  # Split the line into fields
  $fields = StringSplit($lines[$i], ",")

  # Add the fields to the 2D array
  ReDim $csvData[$i][UBound($fields)]
  For $j = 0 To UBound($fields) - 1
    $csvData[$i][$j] = $fields[$j]
  Next
Next

# Display the array
For $i = 1 To UBound($csvData) - 1
  For $j = 1 To UBound($csvData[$i]) - 1
    ConsoleWrite($csvData[$i][$j] & " ")
  Next
  ConsoleWriteLine("")
Next




#######################

 

when I run it, it gives me that $csvData = [] is a syntax error. I argue with the AI and it tells me it's a correct syntax.

 

Is there a way that I can access to all the datas of functions that were made in pdf or text files, (i know it's gonna be 1000 of pages but it's a fast learner!))  send it to the AI so it can learn correclty?

 

Edited by Jos
added codebox... please use <> next time.
Link to post
Share on other sites
  • Developers

Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
On 12/29/2022 at 9:38 PM, MathieuLap said:

send it to the AI so it can learn correclty?

The openAI chat AI does not learn from all interactions, past the current conversation, without gbeing handpicked by the developers, if their FAQ page is anything to go by.
Also, i've played with the AI for a few days and it does seem to understand AutoIt functions fine. What is the biggest issue with the AI and AutoIt seems to be the way it thinks AutoIt array works (JS like arrays with push, and such methods on the array object).

If you can make it understand that the array are a fixed length and cannot be accessed via method calls on the array variable itself, your results will get a lot more plug and play like.

 

But i don't see that as anything worth spending time on, honestly. The AI is fine for HOW you COULD approach a problem, but you should not expect it to produce code that will run without issues, for it is not what the CHAT AI was designed for.

My thoughts anyways....

Link to post
Share on other sites

ChatGPT is advanced autocorrect, and isn't particularly concerned with the correctness of its response. It's focus seems to be on "sounding" as human-like as possible, using natural language, not fact-checking its output.
It's not very useful for coding IMO, unless you're using something very popular like Python and your problem is something for which there are ample examples and solutions in the dataset that ChatGPT has been trained on. I've tried using it with AutoIt and it keeps making up libraries and functions that don't exist. It does the same for Python as well, but slightly less often. Even for python snippets, errors aren't uncommon.

I've found ChatGPT to be useful for pseudocode generation (describe the problem and ask the chatbot to respond in pseudocode) because the particular details of language use etc are abstracted away. I've also found it somewhat useful for refactoring existing code snippets, when I want to clean up a function, use SESE or single responsibility to trim spaghetti code etc.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...