LG-Experiment / Scripts

218 stars 99 forks source link

No output result #2

Open ivityc opened 1 year ago

ivityc commented 1 year ago

I've tried to follow the instruction on the video but I found the following issue 👍 1) if tI use the ts code as is, I get an error ("type error"). I was able to fix the problem enclosing the provided sript inside this code

function main(workbook: ExcelScript.Workbook) { // Your code here }

2) after fixing above problem, I can input a question but I have no answer. Nor errors or warning in the output console.

API works, if I use a curl request with similar settings for model and prompt, I get my answer but in xls nothing happen. I also added some extra logging lines but still no error in Output or Problems view.

Thanks for support.

CoeusInstitute commented 1 year ago

Were you able to figure this out? We are running into an error when we try to execute the script. [ Line 46: Cannot read properties of undefined (reading '0') ]

sanchez617 commented 1 year ago

Error with [ Line 46: Cannot read properties of undefined (reading '0') ]too

LG-Experiment commented 1 year ago

Hi - the most common solution to this error was the API key. Either it wasn't entered correctly - or it was invalid. Best is if you login to openai and make sure that the API key you are using is still valid.

joemuehlhauser commented 1 year ago

I'm also experiencing Error with [ Line 46: Cannot read properties of undefined (reading '0') ]

I generated a new API and carefully made sure it's accurate. Are you aware of any other solutions I might try?

Thank you for doing this and making it accessible to everyone!!

mylearning-lab commented 1 year ago

Hey all, I have the same issue and my API key is valid. Does anyone have solution for this error?

WelshMcSpicy commented 1 year ago

I get a different error: undefined is not an object (evaluating 'json.choices[0]') Sounds like the json response is empty so json.choices is also empty.