Mendix Community

The community-sourced publication for low-code

Follow publication

ChatGPT — Use Cases

Member-only story

ChatGPT Completions API and Image Generation

QUANG NHAT TRAN
Mendix Community
Published in
7 min readFeb 12, 2024

ChatGPT’s API, powered by OpenAI, offers developers access to advanced natural language processing and generation capabilities. It enables the integration of ChatGPT’s conversational AI into various applications, websites, and digital products.

In this article, we will integrate ChatGPT in several use cases. From how to set up and configure the connection, to implementing the completions API with chat history, and finally, image generation using the Dall-e-3 model. Let's get started by learning how to configure the connection.

Configuration:

Go to https://platform.openai.com/api-keys to create an API key for integration. This is the API-keys overview in OpenAI’s platform (https://chat.openai.com/), we are going to build an overview in Mendix to store this information to be used in our requests.

In some APIs we need to use organization ID, you can find it at https://platform.openai.com/account/organization

In Mendix, create one entity for storing the token. To make the article easy to understand, I will not validate the token by checking if it exists, and we won't encrypt and decrypt it every time we use it (but you should do this if possible).

Right-click on the Configuration Entity and select “Generate overview pages”. It will quickly generate an overview and new_edit forms.

Put this overview form onto the navigation.

Then you will have a page that looks like this.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Mendix Community
Mendix Community

Published in Mendix Community

The community-sourced publication for low-code

QUANG NHAT TRAN
QUANG NHAT TRAN

Written by QUANG NHAT TRAN

Certified Mendix Expert MVP, Data Scientist, and Technical Practitioner @ TBN Software

Responses (1)

Write a response