Hi @all If you are having issue with the UI action then please use the below code --------------------------------------------------------------------------------------------------------------------------------- function runClientCode() { gsftSubmit(null, g_form.getFormElement(), "run_server"); } if (typeof window == 'undefined') { runServerCode(); } function runServerCode() { var r1 = new sn_ws.RESTMessageV2('Chat GPT', 'askChatGPT'); r1.setStringParameterNoEscape('prompt', current.u_question); r1.setStringParameterNoEscape('max_token', '1024'); r1.setStringParameterNoEscape('temp', '0.5'); r1.setStringParameterNoEscape('model', 'text-davinci-003'); var response1 = r1.execute(); var responseBody1 = response1.getBody(); var httpStatus1 = response1.getStatusCode(); gs.info("Test "+responseBody1); var responseObject1 = JSON.parse(responseBody1); var test1 = responseObject1.choices[0].text; current.u_answer = test1.trim(); current.update(); action.setRedirectURL(current);
Hi Ravi. Thanks for this great video. Please I need help. After copying and pasting the above scripts, am getting this error message - "Could not save record because of a compile error: JavaScript parse error at line (27) column (35) problem = missing } after function body (; line 27)"
{ "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": "insufficient_quota" } }
Hi Ravi, Thanks for the video. I really enjoy your way of presenting the material. I'm a ServiceNow Admin in League City, Texas. I'm can't wait to see how ChatGPT and other AI's will integrate and improve ServiceNow. One thing that really impresses me are your thumbnails. Do you mind sharing how you come up with such striking thumbnails?
gsftSubmit is used to execute the Server-side section of the script after the client-side portion has been completed successfully. validation is not successful at the Client side, Server-side function would not be initiated. This can be achieved without using client and action name Passing Action name as parameter in gsftSubmit ensures the Client side validation to move ahead. Although Great Work!!
Hi Ravi, This is great video. I learned a lot. Is it possible to open a ticket in serviceNow using ChatGPT or OpenAI after we search for something in chatGPT?
Integration is not my cup of tea but ur integration videoes are so easy to understand. in the rest message content on what basis u have given json as model prompt temp etc is this static and mentioned in the document to use this? or how?? this might be very basic question but would like to know
@@learnservicenowwithravi I tried the same, looks like model davinci is deprecated and a new one has come instead and the new one throws 429 error code and I was wondering if it's because of free account. Could you please help?
Hi Ravi, Thanks for the Video. When I click on Test Run, I get the message "You exceeded your current quota, please check your plan and billing details."". Is there any paid subscription needed for chatGpt?
Hi .. you don’t need any paid subscription.. create new account with different email on chat gpt and try again .. it will work.. The same happened to me for the first time..I did the same.
Hi Ravi, we have a use case where boomi uses their real time inbuilt connector to connect with servicenow to read and pick an HR case record report from ServiceNow. We have shared the end point(from rest api explorer) and authentication details with Boomi.. how can we faciliate for boomi to pick up the report? do we need to do any steps in order to automatically generate and export reports in servicenow for boomi to pick up? how can we do this
Sir your videos are too Helpful.I want to know I am fresher 2023 passout Can I get a Job as a fresher ServiceNow Developer As I can't see much jobs for fresher.Almpst every company is demanding 3-4 years of Company .Can you guide me how to start a job or internship as a fresher .
Hi Ravi, I followed the same steps that you mentioned...also tried the updated script from comments but I'm not getting the correct response. HTTP Method gives the response but the UI Action doesn't. Here is what I see in the response: " || typeof window === "undefined") { global.window = {} } const { JSDOM } = require("jsdom") const { document } = (new JSDOM(`...`)).window global.document = document Can you please help me solve this?
Hlo Ravi can u guide me i got error like this"error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota",
Hey thanks for the video, my rest message is working but Ui action is not working when I click on the created button the form is reloading while clearing the values.
Hi , While doing Test , in HTTP status [ 429 ] , Response is { "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": null } } I have followed as per your video , where i have made mistake .
hi ravi, i mailed you regarding the image integration and currently also unable to fetch data from this chatgpt integration altough i follow every steps you did but on clicking give me answer button its not giving the result...kindly help regarding also plz reply on the mail....have a good day : )
I get this Error - Pls help { "error": { "message": "The model `text-davinic-003` does not exist", "type": "invalid_request_error", "param": null, "code": "model_not_found" } }
I am greeting error like " You exceeded your current quota, please check your plan and billing details" ,created another accounts but still same error any idea how to resolved it .watch video on you tube but not looking promising asking me to connect to some France server
There are three reasons you might receive the "You've reached your usage limit" error: If you're using a free trial account, remember that the tokens granted in this trial expire three months after account creation. To continue using the API after that point, you'll need to enter billing information and upgrade to a paid plan. Another potential explanation is that you may have created multiple accounts using a single phone number. We only grant free tokens to the first account created with a given phone number. In this situation, the solution is to log into the account you originally created to access those initial free tokens. If you're already on a paid plan, you may need to either increase your monthly usage hard limit. To set your limit over the approved usage limit (normally, $120.00/month) please submit a quota increase request. Why did I get charged if I'm supposed to have free credits? Only the first API account verified with a given phone number is granted free trial tokens. A phone number can be used up to 2 times to verify sign ups. We only provide the free trial tokens to the first sign up, not more.
Great video. Thank you for doing this. After some troubleshooting, I was finally able to complete this. My problem was that I was able to get the response from ChatGPT within the REST API testing, but the UI Action did not work. I had to add the following code after the gsftSubmit function. if (typeof window == 'undefined') runRestAPICode(); function runRestAPICode() { var r = new sn_ws.RESTMessageV2('Chat GPT', 'GetGPTResponse'); .......
Hi Ravi It's not working, and i checked many videos of all the videos. is the same as like your video, but now this method is not help full Can you please help me
Does anyone have this error ? { "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": null } }
Hi Ravi, thank you for the information and useful vedio. I have configured everything as you did. When I am testing my method then I am getting response, however when I click on the UI action then I do not get logs, I guess script does not run. my script : function runClientCode() { gsftSubmit(null, g_form.getElement(), "run_server"); } gs.info("IAMIN"); var r = new sn_ws.RESTMessageV2('ChatGPT', 'ChatGPTResponse'); r.setStringParameterNoEscape("temp", '0.5'); r.setStringParameterNoEscape("prompt", current.u_ask_any_question); r.setStringParameterNoEscape("max_tokens", '1024'); r.setStringParameterNoEscape("model", 'text-davinci-003'); var response = r.execute(); gs.info("IAMIN1"); var responseBody = response.getBody(); var httpStatus = response.getStatusCode(); gs.info("IAMIN2 Response " + responseBody); var jsonObj = JSON.parse(responseBody); var reply = jsonObj.choices[0].text; current.u_your_answer = reply; current.update(); action.setRedirectURL(current);
i get "Basic authentication failed for user: mid_server_atr" when running from the UI Action, From the Rest Message setup the test works no problem. Below is my script. function runClientCode() { gsftSubmit(null, g_form.getElement(), "run_server"); if (typeof window == 'undefined') runRestAPICode(); } function runRestAPICode() { var r = new sn_ws.RESTMessageV2('Chat GPT', 'GetGPTResponse'); r.setStringParameterNoEscape('model', 'text-davinci-003'); r.setStringParameterNoEscape('prompt', current.u_ask_any_question); r.setStringParameterNoEscape('max_token', '1024'); r.setStringParameterNoEscape('temp', '0.5'); var response = r.execute(); var responseBody = response.getBody(); var httpStatus = response.getStatusCode(); gs.log("The response body== " + responseBody); }
I'm getting the below 429 error in the REST Message { "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": "insufficient_quota" } }
Hi am getting the following error in .log The response body== {"id":"cmpl-78ppn9kqT1K9rZhpPi9OrXtLsqdBS","object":"text_completion","created":1682340231,"model":"text-davinci-003","choices":[{"text":", I am using the \"Get Current User\" action in my Flow. The action is returning the user's display name, but I need to get the user's email address. Is there any way to get the user's email address from this action? Thanks!","index":0,"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":1,"completion_tokens":61,"total_tokens":62}}