
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
02-12-2023 09:02 AM - edited 11-13-2024 07:55 PM
NOTE: Currently the Codex API's are not working properly. Please use this as a reference when you are using a subscription based ChatGPT.
Introduction
As I have been hearing a lot about how powerful ChatGPT is, thought of integrating into Servicenow. While checking the features of ChatGPT I was really impressed with the Code Search that is offered by ChatGPT. It's very powerful and gives you the exact code as per your requirement.
Examples:
angular js code button click go to gmail.com
Servicenow code for delete a record
Step 1 - ChatGPT
Create an account in https://platform.openai.com/
Once you create account, login using the credentials and get the API Key / Bearer Token from https://platform.openai.com/docs/quickstart/build-your-application
Click on “Create new secret key”, copy the key and save it in a notepad/in some other.
Step 2 - Servicenow
Download the Update set from the Share Location
Once you commit the update set, modify the System Property called “chatgpt.token” and store the ChatGPT API Key like this in your Servicenow Instance.
Bearer <your api key>
Now, you are ready to use the Tool. Go to the Filter Navigator and type "ChatGPT" ==> "Code Search"
On the Search bar, type your requirement and you will get the code based on your requirement like this.
Note:
- All the code results that you see here are completely from ChatGPT AI Engine. Sometimes the results may vary based on the response that it will get from the API.
- Also, sometimes you may see few unnecessary html tags because of the format issues. But overall you can easily identify the code that you need to copy from this and use it for your own purpose.
- At present, only the admins can access this Tool, but you may change it based on your requirement.
Thank You
Narsing
- 4,793 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Narsing1 I have imported the updateset but I am getting response as "Sorry! you have no results" any thoughts on why client script is going to exxception?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Looks like Code Davinci not working at this moment. Checking the API details.
Thanks,
Narsing
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Narsing1 I tried with 'text-davinci-003' but my prepaid balance expired. I am trying to reload but getting page error issue.
i will try and let you know if new model is working. Please also keep me posted with your findings. Thankyou.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks @Narsing1 . Please note that after committing the update set, I can see the ChatGpt option in the menu but it's not working. Please see the screenshot. This may be because I just couldn't find the System Property called “chatgpt.token”. Please advise how to find this property so that I can update my OpenAI API key there.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Looks like Codex API's are not working and also I am hearing that OpenAI is discontinuing its support on Codex.
I am still trying to see whether it has provided any other way. Since Codex is only a Beta, we may not expect much.
As far as the API Call and other logic in this update is concerned, it is in the correct way. Please check the OpenAI community as well for more information.
Thanks,
Narsing
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for the response @Narsing1
As of March 2023, the Codex models are now deprecated. Please check out our newer Chat models which are able to do many coding tasks with similar capability
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Narsing1 Have you applied the update provided by @Yogesh Shinde to your cod yet?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I did update the chatgpt.token system property and provided the bearer token. But still the same error as the codex models are now deprecated.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
So just to be clear, this ChatGPT search no longer works and the share project simply hasn't been taken down, correct?
I get the same errors as all the others on this page.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Likewise - SORRY! Not able to find your code at this moment is the response to all queries

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hey,
Sorry.. I didn't go through with the latest API's and it was done almost 2 years back. Looks like the Codex api's are not working properly at present.
Could be some subscription issues. Not sure whether it needs a paid subscription at present. But I am sure the concept will be the same to use the API.
Thanks,
Narsing