Skip to content

Latest commit

 

History

History

DelphiChatGPT

ChatGPT for Delphi

By Bruno Fierens

Access the ChatGPT REST API from a Delphi app

Technologies Used

  • Delphi VCL or FMX
  • Delphi JSON

Description

This demo program demonstrates how to use Delphi to access ChatGPT, a large-scale pretrained transformer language model for generating human-like text. This version of the program is updated to use the standard Delphi REST components. The program allows the user to input a prompt and receive a response from ChatGPT in real-time. The program makes use of the OpenAI API to send the prompt to ChatGPT and receive the response.

To use the program, the user first needs to obtain an API key from OpenAI and add it to a file called APIKEY.inc. The user can then input the prompt into the program, and the program will use the API key to send the prompt to ChatGPT and display the response in the program's output window. The program also provides options for the user to customize the response, such as specifying the number of responses to generate or the maximum length of the response.

This demo program is a useful tool for developers who want to learn how to use Delphi to access large language models like ChatGPT and incorporate them into their own projects. It is also a fun way for anyone to interact with ChatGPT and see the kind of responses it can generate.

Setup/Installation Requirements

Known Bugs

  • No issues reported

License

MIT

Copyright (c) Dec 2022 by Bruno Fierens tmssoftware.com