ChatGPT3

ChatGPT in VSCode

As we know OpenAI’s ChatGPT has gained popularity in past few months. Microsoft has integrated the AI feature into number of their products like MS Team, PowerApps, Power Automate, PowerBI, Word, PowerPoint, Outlook, recently in Bing search engine and Edge web browser. List goes on and on.

The latest in the queue is the ChatGPT extension for VSCode. ChatGPT extension as co-pilot will help Developers to write fast and efficient code without switching the context between multiple apps.

Developers can use this free extension to Write Code, Find Bugs, Generate Comments, Optimize Code, Create Test Cases. Complete Code. Yes this extension can help you to complete half written/ incorrect code. It provide correct code snippets

It works like charm!!

Watch below video to understand the capabilities 📽️

Getting Started with OpenAI API and Postman

Recently there is a big wave about Artifical Intelligence from Open AI, you may see people have started talking about Chat GPT-3 (Generative Pre-training Transformer). As name suggest it is one of the largest language Pre-Trained model which uses deep learning to produce human like answers.

Did you Know?

Open AI’s GPT-3 is the largest Language Model having 175 BN parameters, 10x more than that of Microsoft’s Turing NLG

In this article I will show you the process to leverage Open AI APIs, so let’s begin:

1. Create New Account on OpenAI web site
 2. Get API Keys
  • Click on Personal menu link in top right ribbon 
  • Click on ‘View API keys’
  • Click on ‘Create new secret key’ button, it will generate new API secret key
  • It will generate new API key, something like in this format sk-<random text>. Copy this key and keep at safe place. You would need this to call OpenAI APIs
  • Important Note: As of writing this blog, OpenAI does not provide official API for ChatGPT. One can use an existing models to get answers that are somewhat similar to the ChatGPT capabilities: Davinci.
3. Call OpenAI API with Postman
  • Open Postman Application
  • Enter URL as https://api.openai.com/v1/completions
  • Select POST HTTP method
  • In Authorization tab, select TYPE as ‘Bearer Token’
  • Paste API key (from Step 2) in token field
  • Now we need to send query/prompt in API body, so to do that select Body tab, select raw format as JSON and paste your JSON like this.
  • In this example we are using text-davinci-003 model and asking it to correct English Grammer in given sentense
  • Once done, click on Send button
  • The JSON response will return sentense with correct English Grammer.
 
Congratulations!! with this you learned how to consume OpenAI API using Postman client. Similarly you can explore many more features on OpenAI website on examples page. 
This includes Classification, Translation, Code etc.