HemulGM / DelphiOpenAI

OpenAI API wrapper for Delphi. Use ChatGPT, DALL-E, Whisper and other products.
MIT License
241 stars 58 forks source link

Problems in Delphi 11 #42

Closed ManoloGC closed 6 months ago

ManoloGC commented 7 months ago

Hi, When I run this code in Delphi 11, I get this error "Error sending data: (12030) La conexión con el servidor finalizó anormalmente.". Whats the problem?

Thansk.

procedure TForm1.CornerButton1Click(Sender: TObject); var OpenAI: TOpenAI; begin

OpenAI := TOpenAI.Create(API_KEY2) ; try

openAI.Organization:=ORGANIZATION_ID; var Completions := OpenAI.Completion.Create( procedure(Params: TCompletionParams) begin Params.Prompt(Memo1.Text); Params.MaxTokens(2048); end);

try
  for var Choice in Completions.Choices do
    Memo2.Lines.Add(Choice.Index.ToString + ' ' + Choice.Text);
finally
  Completions.Free;
end;

finally OpenAI.Free; end; end;

HemulGM commented 7 months ago

Watch whether you have an affordable connection to the server. Let me remind you that the API since recently is also not available in a number of countries. In addition, the servers are often busy and requests are completed with a timeout (it can be increased).

ManoloGC commented 7 months ago

its problem of antivirus.

Enviado desde Outlook para Androidhttps://aka.ms/AAb9ysg


From: HemulGM @.> Sent: Wednesday, April 10, 2024 11:24:18 AM To: HemulGM/DelphiOpenAI @.> Cc: ManoloGC @.>; Author @.> Subject: Re: [HemulGM/DelphiOpenAI] Problems in Delphi 11 (Issue #42)

Watch whether you have an affordable connection to the server. Let me remind you that the API since recently is also not available in a number of countries. In addition, the servers are often busy and requests are completed with a timeout (it can be increased).

— Reply to this email directly, view it on GitHubhttps://github.com/HemulGM/DelphiOpenAI/issues/42#issuecomment-2047008203, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALBGVXH6Z7G43C6QSZHHMOTY4UAMFAVCNFSM6AAAAABFZA35G2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGAYDQMRQGM. You are receiving this because you authored the thread.Message ID: @.***>