Create a VCL Form using Delphi XE to implement Open AI ChatCompletions API
Maksettu toimituksen yhteydessä
The task is to create a VCL Form (not necessarily a full application) which implements Open AI Chat API like the Chat GPT website. The VCL form (not FireMonkey) will be included in an existing larger desktop application to implement the chat feature. To be clear, it has to be a VCL Form, not a Console App.
Please note the following requirements:
1. Must use "Delphi OpenAI API" library. This is freely available on GitHub ([login to view URL]) and can be installed using Delphi's GetIt installer.
2. There are no components to install. The library consists of a bunch of .Pas files which implement OpenAI API in Delphi.
3. The request is NOT for "Completions" endpoint - we have that figured out using this library. The request is for ***CHAT***. The difference is explained here: [login to view URL]:~:text=%2Fcompletions%20endpoint%20provides%20the%20completion,corresponding%20to%20the%20message%20history.
4. The user interface you create is not important. It could simply be: (a) a Memo (user's question), (b) a button to send question to Open AI, and (c) a Memo to display the response which is added to the previous responses.
5. Key Point: Like Open AI, the previous responses can be included in the future questions, or multiple documents can be sent sequentially to overcome limit on number of Tokens per request. In other words, we should be able to send a number of documents/prompts one by one like they do at: [login to view URL] The user should be able to add statements like "Improve the previous response by doing X."
6. Very Important: The Code should be CLEARLY and COPIOUSLY documented, especially about the API calls. The API uses JSON which could be confusing to new developers. Please add clear comments. Your code will need to be modified to include in the existing app so clarity is very important.
6. If desired, we can provide you the VCL form as an example which successfully implements Completions endpoint using the "Delphi OpenAI API." We want similar functionality for Chat.
Note: In the future, we may open to other "Standard" Tools/APIs in Delphi but not to some obscure API/Library which disappears tomorrow or may not be upgraded as OpenAI API evolves quickly. If you propose a different method then please clearly outline its benefits over the simple "Delphi OpenAI API" approach.
We are using Delphi 11.3. However, your solution can be developed in earlier versions of Delphi.
Quick response time is important and greatly appreciated!
Projektin tunnus: #36703024