ian-kent / gptchat

A GPT-4 client which gives your favourite AI a memory and tools for self-improvement
MIT License
351 stars 51 forks source link

Unable to create the new plugin directory #6

Closed Explorergt92 closed 1 year ago

Explorergt92 commented 1 year ago

Trying to run the example in the video. I've entered the same user inputs as the video but I am getting the following responses...

AI: I apologize for the error. It seems there was an issue with the plugin creation. Let me correct it and try again. AI: It seems there was an issue with creating the plugin directory. Let me try again with a different plugin ID. AI: I apologize for the inconvenience. Unfortunately, there seems to be an issue with creating and compiling the plugin for generating random numbers. I will not be able to provide you with the sum of two random numbers by creating a plugin at the moment.

I've tried running the .exe as admin and still have the issue

ian-kent commented 1 year ago

Could you try using the /debug command to enable debug mode and see what output you get?

It's probably because you're using Windows, this was built on MacOS and I haven't spent any time making it work cross-platform, but the debug output should help point to the problem.

Zinnusl commented 1 year ago

See #4 - same problem I got. Seems Go can't build in plugin format on windows at the moment. Or that the plugin directory exists already. I created a pull request for that issue.

Explorergt92 commented 1 year ago

USER:

Great! I'd like you to generate two random numbers and add them together. Maybe you could create some plugins to help with that?

AI:

/plugin create generate-random-number

[DEBUG] MODULE:

An error occurred executing your command.

The command was:
```
/plugin create generate-random-number

The error was:
```
error compiling plugin: exit status 1
```

The error was:
```
error compiling plugin: exit status 1
```

AI:

I apologize for the errors. Let me correct the code and try creating the plugins again.

/plugin create generate-random-number

/plugin create add-integers

[DEBUG] MODULE:

An error occurred executing your command.

The command was:
```
/plugin create generate-random-number
```

The error was:
```
error creating directory: mkdir ./module/plugin/source/generate-random-number: Cannot create a file when that file already exists.
```

[DEBUG] MODULE:

An error occurred executing your command.

The command was:
```
/plugin create add-integers
```

The error was:
```
error creating directory: mkdir ./module/plugin/source/add-integers: Cannot create a file when that file already exists.
ian-kent commented 1 year ago

It sounds like you're on Windows so it probably is the same problem @Zinnusl is seeing - I had no idea plugins weren't supported on Windows, but the go docs do say it's only supported on unix based systems.

Having said that, I'd have expected more useful output with this bit: "error compiling plugin: exit status 1"

It should be possible to add support for other plugin backends though, and that may be safer (e.g. using something like otto means GPTs code runs in an isolated VM without fetch, etc)

Explorergt92 commented 1 year ago

I tried it in WSL and it worked after I moved somethings around. I tried just running it from the C:\Users\username\Projects\gptchat folder go build go run gptchat package gptchat is not in GOROOT (/usr/local/go/src/gptchat)

I had to copy the folder to the right place for WSL sudo cp -r /mnt/c/Users/username/Projects/gptchat /usr/local/go/src/gptchat

Then cd /usr/local/go/src/gptchat go get github.com/ian-kent/gptchat go get github.com/sashabaranov/go-openai

go run gptchat

And it successfully created the plugins...

USER:

Great! I'd like you to generate two random numbers and add them together. Maybe you could create some plugins to help with that?

AI:

It seems there was an issue while trying to create the "generate-random-number" plugin. However, the "add-two-numbers" plugin has been successfully created. Let me check to see if the "generate-random-number" plugin already exists and generate two random numbers for you.

AI:

The "generate-random-number" plugin was not listed among the available commands. I'll create a new version called "generate-random-number-v2" and try again.

AI:

I have successfully created the "generate-random-number-v2" plugin. Now I'll generate two random numbers and add them together using the "add-two-numbers" plugin.

AI:

I have generated two random numbers: 13 and 31. Now I will add them together using the "add-two-numbers" plugin.

AI:

I have added the two random numbers, 13 and 31, together, and the result is 44.
ian-kent commented 1 year ago

I've watched it do this many times already but it still blows my mind every time 😅

Glad you managed to get it working!