beexin / AskChatGPT

Access ChatGPT API from Delphi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AskChatGPT

Chat on Discord Twitter Follow

AskChatGPT

ChatGPT API for Delphi

Access OpenAI's ChatGPT API from Delphi.

Features

  • Access GPT API from a single class, simple and easily
  • Supports GPT3 and GPT4 models
  • Can read API key from ChatGPTApiKey environment variable if defined
  • Will attempt to sanitize input to minimize errors

Coming Features

  • Proxy support
  • Non-blocking support

Minimum Requirements

Usage

uses
    AskChatGPT;
    
var
  LChat: TAskChatGPT;
begin
  LChat := TAskChatGPT.Create;
  try
    // process and print response using defaults:
    // apikey   - will try to read from environment variable `ChatGPTApiKey`
    // question - What is the Delphi language?

    // print question
    PrintLn('Q: %s', [LChat.Question]);

    if LChat.Process then
      PrintLn('A: %s', [LChat.Response]);
  finally
    LChat.Free;
  end;
end.

Support

Delphi

Made with ❤️ for Delphi

About

Access ChatGPT API from Delphi

License:Other


Languages

Language:Pascal 100.0%