Unable to compile chat example
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'
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.