DEV Community

Cover image for Integrating With OpenAi(ChatGPT)(With Code example)
Mohammad ALi Abd Alwahed
Mohammad ALi Abd Alwahed

Posted on

1

Integrating With OpenAi(ChatGPT)(With Code example)

If your project's requirement puts you in need of integrating it with OpenAi here is a brief depending on OpenAi documentation of how to do that :
First, you need to make your needs clear because OpenAi depends on many models and engines each one of them is an Ai model trained on a specific amount of data and can provide a limited amount of words or types of responses.
Based on the type of response it goes for 2 main categories :
Completion:
In this type, the usage will be for the completing and text you send and as an example of it :
text-davinci-001,text-davinci-002,text-davinci-003
the number in the end represent the accuracy of the response,davinci 3 is the highest.

Image description
Chat:
In this type, the usage will be for the Chat and it works 100% the same as you are chatting with Chatgpt, as an example of its models :
gpt-3.5-turbo,gpt-3.5-turbo-0613 ..etc
gpt-3.5-turbo-0613 is the newest one and the one with the highest accuracy,code example:

Image description
Note: please note that as much as you raise your accuracy the response time will be higher.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay