FlowFuse / node-red-function-gpt

A Node-RED node that adds "Ask ChatGPT" option to a duplicate of the built-in function node.
Apache License 2.0
29 stars 2 forks source link

'Ask ChatGPT' button always disabled #23

Closed devheyaragon closed 9 months ago

devheyaragon commented 11 months ago

Current Behavior

First of all: this Node is an excellent idea, KUDOS!

I wanted to try it immediately as it would be an excellent help to our customers, electricians not necessarily skilled in programming.

I have installed the node and configured the OpenAI API key. Not sure what I should put in the organization field, for now, I've set it to 'Personal'. And deployed.

However the 'Ask ChatGPT' button always disabled remains disabled.

Expected Behavior

No response

Steps To Reproduce

Install and configure as described.

Environment

joepavitt commented 11 months ago

Hi @devheyaragon - thanks for the feedback here. Our README is missing a key piece of guidance re: organisation ID, I'll get that added shortly, but in the mean time, the Org ID can be found here:

https://platform.openai.com/account/org-settings

Screenshot 2023-09-21 at 09 35 43
joepavitt commented 11 months ago

It's worth noting though, that even with incorrect credentials, the "Ask ChatGPT" button should still be enabled, as that's enabled with the Editor is deemed "ready":

https://github.com/flowforge/node-red-function-gpt/blob/e2163318328f2b0a1d75efdd1b92522b1ad756af/index.html#L872-L876

Am noting that it has a fixed timeout though, and assumes the editor would have loaded in that time period (which it should have), but there may be a race condition where the Code Lens stuff may be erroring. I can only think there may be a problem with use of Monaco Editor on your machine/instance?

@Steve-Mcl any thoughts here?

devheyaragon commented 11 months ago

Thanks for the organization ID, I've entered it but the problem remains. There's nothing exciting in the node-red server log, but in the browser console, this comes up when I open the 'edit function-gpt' node. Any advice? VM405:704 Uncaught ReferenceError: monaco is not defined at setupCodeLens (:704:40) at :747:17

joepavitt commented 11 months ago

This is getting into Node-RED core, which is not my area. @Steve-Mcl will be able to advise accordingly here.

Steve-Mcl commented 11 months ago

VM405:704 Uncaught ReferenceError: monaco is not defined

What version of Node-RED are you using?

joepavitt commented 11 months ago

What version of Node-RED are you using?

He listed 3.1 in the original issue

devheyaragon commented 11 months ago

I'm using latest stable v.3.1.0

On Thu, Sep 21, 2023 at 3:01 PM Stephen McLaughlin @.***> wrote:

VM405:704 Uncaught ReferenceError: monaco is not defined

What version of Node-RED are you using?

— Reply to this email directly, view it on GitHub https://github.com/flowforge/node-red-function-gpt/issues/23#issuecomment-1729520376, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAZER3QII4UHJTOYSRCN2B3X3Q3CHANCNFSM6AAAAAA5A73GPM . You are receiving this because you were mentioned.Message ID: @.***>

Steve-Mcl commented 11 months ago

My apologies I missed that, Thanks.

Now that I know this, can you do 2 things.

No. 1

No. 2


Alternatively, provide a copy of the "System info" from the action list: CTRL+SHIFT+P -> "system info" -> copy to clipboard chrome_WA2RURdLpv

devheyaragon commented 11 months ago

Hello, and thank you for looking into this! As noted earlier, the "VM405:704 Uncaught ReferenceError: monaco is not defined" appears as soon as I open the Edit function-gpt node. I'm running a stand-alone Node-RED on a local computer [image: image.png] { "report": "diagnostics", "scope": "basic", "time": { "utc": "Fri, 22 Sep 2023 06:19:00 GMT", "local": "9/22/2023, 8:19:00 AM" }, "intl": { "locale": "en-US", "timeZone": "Europe/Paris" }, "nodejs": { "version": "v18.18.0", "arch": "arm64", "platform": "linux", "memoryUsage": { "rss": 139378688, "heapTotal": 74801152, "heapUsed": 69231376, "external": 3786037, "arrayBuffers": 1887997 } }, "os": { "wsl": false, "totalmem": 4024745984, "freemem": 2848792576, "arch": "arm64", "loadavg": [ 0.01, 0.19, 0.24 ], "platform": "linux", "release": "4.19.193", "type": "Linux", "uptime": 15529.06, "version": "#3 SMP PREEMPT Thu Aug 25 21:05:15 CST 2022" }, "runtime": { "version": "3.1.0", "isStarted": true, "flows": { "state": "start", "started": true }, "modules": { "node-red": "3.1.0", "node-red-contrib-https": "2.0.0", "node-red-contrib-interval": "0.0.1", "node-red-contrib-join-wait": "0.5.3", "node-red-contrib-knx-ultimate": "1.4.18", "node-red-dashboard": "3.5.0", "node-red-node-base64": "0.3.0", "node-red-node-ui-table": "0.4.3", "node-red-contrib-enocean": "0.8.5", @.***/node-red-function-gpt": "0.2.1" }, "settings": { "available": true, "apiMaxLength": "UNSET", "disableEditor": false, "contextStorage": { "default": { "module": "localfilesystem" } }, "debugMaxLength": 1000, "editorTheme": { "palette": {}, "projects": { "enabled": false, "workflow": { "mode": "manual" } }, "codeEditor": { "lib": "ace", "options": { "theme": "vs" } }, "menu": { "menu-item-help": { "label": "Node-RED Library", "url": "https://github.com/devheyaragon/nodered" } } }, "flowFile": "flows.json", "mqttReconnectTime": 15000, "serialReconnectTime": 15000, "socketReconnectTime": "UNSET", "socketTimeout": "UNSET", "tcpMsgQueueSize": "UNSET", "inboundWebSocketTimeout": "UNSET", "runtimeState": "UNSET", "adminAuth": "SET", "httpAdminRoot": "/", "httpAdminCors": "UNSET", "httpNodeAuth": "UNSET", "httpNodeRoot": "/", "httpNodeCors": "UNSET", "httpStatic": "UNSET", "httpStaticRoot": "UNSET", "httpStaticCors": "UNSET", "uiHost": "SET", "uiPort": "SET", "userDir": "SET", "nodesDir": "UNSET" } } }

On Thu, Sep 21, 2023 at 4:44 PM Stephen McLaughlin @.***> wrote:

My apologies I missed that, Thanks.

Now that I know this, can you do 2 things. No. 1

No. 2

  • Provide a copy of your node-red start up log (from "Welcome to Node-RED" message upto the " Started flows" message)
    • feel free to XXXXX anything you feel is sensitive info

Alternatively, provide a copy of the "System info" from the action list: CTRL+SHIFT+P -> "system info" -> copy to clipboard [image: chrome_WA2RURdLpv] https://user-images.githubusercontent.com/44235289/269653967-39e41acd-af99-484f-87c8-c67a6121e7f7.gif

— Reply to this email directly, view it on GitHub https://github.com/flowforge/node-red-function-gpt/issues/23#issuecomment-1729731931, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAZER3RA7Q7RC6ZT5R3Z4RDX3RHE5ANCNFSM6AAAAAA5A73GPM . You are receiving this because you were mentioned.Message ID: @.***>

devheyaragon commented 11 months ago

Hello, did the provided debug information help, can I provide more?

joepavitt commented 11 months ago

Hey @devheyaragon - we've been very busy with an impending release of FlowFuse (due today) so haven't had the chance to follow up. Hoping that Steve will be able to help/advise this afternoon (UK time)

Steve-Mcl commented 11 months ago

"codeEditor": { "lib": "ace",

Is there any reason you are using the old (soon to be depreciated) ACE editor?

It doesnt support many new features of JavaScript lang.

If you change to monaco, this will work for you.

Steve-Mcl commented 11 months ago

"codeEditor": { "lib": "ace",

Is there any reason you are using the old (soon to be depreciated) ACE editor?

It doesnt support many new features of JavaScript lang.

If you change to monaco, this will work for you.

NOTE: That ↑ does not mean we won't be making it editor agnostic, just that time is the enemy. It will get updated (hopefully soon)

devheyaragon commented 11 months ago

Thank you for the reply ! I will switch to Monaco and try it again. And thank you for pointing at the Monaco editor, I wasn't aware.. The reason we're still using the default ace editor is we have many users out there running various versions of Node-RED.

On Wed, Oct 4, 2023 at 5:42 PM Stephen McLaughlin @.***> wrote:

"codeEditor": { "lib": "ace",

Is there any reason you are using the old (soon to be depreciated) ACE editor?

It doesnt support many new features of JavaScript lang.

If you change to monaco, this will work for you.

NOTE: That ↑ does not mean we won't be making it editor agnostic, just that time is the enemy. It will get updated (hopefully soon)

— Reply to this email directly, view it on GitHub https://github.com/FlowFuse/node-red-function-gpt/issues/23#issuecomment-1747071961, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAZER3XJR3RJSKKLAP7AHYTX5V7VZAVCNFSM6AAAAAA5A73GPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGA3TCOJWGE . You are receiving this because you were mentioned.Message ID: @.***>

joepavitt commented 9 months ago

@devheyaragon - any update here? Assume switching to monaco editor did the trick?

devheyaragon commented 9 months ago

Yes, we switched to monaco so it is no longer an issue from our point of view, Thanks for the support

On Fri, Nov 24, 2023 at 3:30 PM Joe Pavitt @.***> wrote:

@devheyaragon https://github.com/devheyaragon - any update here? Assume switching to monaco editor did the trick?

— Reply to this email directly, view it on GitHub https://github.com/FlowFuse/node-red-function-gpt/issues/23#issuecomment-1825754255, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAZER3SBLCOCF56TKSOJPZTYGCVQ3AVCNFSM6AAAAAA5A73GPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVG42TIMRVGU . You are receiving this because you were mentioned.Message ID: @.***>