Code Monkey home page Code Monkey logo

Comments (9)

wlandgraf avatar wlandgraf commented on May 29, 2024

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/

from openai-delphi.

limelect avatar limelect commented on May 29, 2024

Sorry, this https://github.com/fpiette/DelphiChatGPT project works like a charm.
And there is one more both work fine

from openai-delphi.

wlandgraf avatar wlandgraf commented on May 29, 2024

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:

https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392

from openai-delphi.

mikelustosa avatar mikelustosa commented on May 29, 2024

I have the same problem. Windows 8.1 upgraded to Windows server 2012 R2.

from openai-delphi.

wlandgraf avatar wlandgraf commented on May 29, 2024

@mikelustosa Have you tried the fixes suggested in the link I posted?

from openai-delphi.

mikelustosa avatar mikelustosa commented on May 29, 2024

@mikelustosa Have you tried the fixes suggested in the link I posted?

Yes. Not work. 😕

from openai-delphi.

wlandgraf avatar wlandgraf commented on May 29, 2024

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?

from openai-delphi.

limelect avatar limelect commented on May 29, 2024

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

Screenshot - 23_02_2023 , 10_44_43

from openai-delphi.

wlandgraf avatar wlandgraf commented on May 29, 2024

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.

from openai-delphi.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.