DelphiGemini icon indicating copy to clipboard operation
DelphiGemini copied to clipboard

Unable to compile chat example

Open SofttouchCode opened this issue 10 months ago • 1 comments

When I try to compile this code:

var Chat := Gemini.Chat.Create('models/gemini-1.5-pro', procedure (Params: TChatParams) begin Params.Contents([TPayload.Add('Write a story about a magic backpack.')]); end); // For displaying, add a TMemo on the form try Display(Memo1, Chat); finally Chat.Free; end;

I get E2010 Incompatible types: 'TProc<TChatParams>' and 'Procedure'

SofttouchCode avatar Jul 08 '25 23:07 SofttouchCode

Hi SofttouchCode,

After testing your code in Delphi CE (version 12.1), I did not encounter the compilation error you mentioned.

Could you please pinpoint the exact line or section of code where the compiler reports this issue? I would also need more context about the runtime environment and the conditions under which the error occurs.

Without these detailed pieces of information, I’m afraid I won’t be able to help you correct your code.

MaxiDonkey avatar Jul 09 '25 23:07 MaxiDonkey