Closed limelect closed 1 year ago
I believe this is not related to the library, but with your local computer trying to access the OpenAI API. From your screenshot, my guess is that you are using an old Windows version?
OpenAI seems to use Let's Encrypt certificate, so I guess you are hitting this issue:
https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/
Sorry, this https://github.com/fpiette/DelphiChatGPT project works like a charm. And there is one more both work fine
The mentioned project uses a different library to perform HTTP requests. I don't know what is the "one more" you mentioned. This library doesn't do anything regarding HTTP request. It just uses the built-in Delphi classes, which in turn uses WinHTTP as far as I know.
Maybe you are hitting the TLS 1.2 issue then, you can try this:
I have the same problem. Windows 8.1 upgraded to Windows server 2012 R2.
@mikelustosa Have you tried the fixes suggested in the link I posted?
@mikelustosa Have you tried the fixes suggested in the link I posted?
Yes. Not work. 😕
So, you installed the root certificate manually, and also enabled TLS 1.2 and TLS 1.3, and neither work? What is the exact error message you get?
I Made my own. I took 2 projects one that works and the other that does not (certificate problem) but has a great screen and merged them It is a VCL and FMX merged together
There is now an option to use Indy to connect to OpenAI API. You can switch to it using a code like this:
uses {...}, OpenApiRest, OpenApiIndy, IdHTTP;
procedure TMainDataModule.IndyClientCreated(Client: TIdHTTP);
begin
// Set extra Client properties here
end;
procedure TMainDataModule.DataModuleCreate(Sender: TObject);
var
Factory: TIndyRestRequestFactory;
begin
// At the beginning of your application, set the DefaultRequestFactory
Factory := TIndyRestRequestFactory.Create;
DefaultRequestFactory := Factory;
Factory.OnClientCreated := IndyClientCreated;
end;
More info in this link: https://github.com/landgraf-dev/openapi-delphi-generator#client-compatibility
This change will probably allow the client to work better on old Windows versions which don't support the latest ciphers used by the API server.