ingilizce kelimeleri ai' la türkçeye çeviren bir kod yazmaya çalısıyorum ancak yazdığım kelimeler çevirilmiyor, aynı şekilde ekrana yazılıyor. yardımcı olur musunuz
var kelimeForm: TclForm; kartPanel: TclProPanel; frontFace, backFace: TclProPanel; lblEnglish, lblTurkish: TclProLabel; txtInput: TclProEdit; btnSorgula: TclProButton; MyOpenAIEngine: TclOpenAIEngine;
void BtnSorgulaClick;
{ if (txtInput.Text == '') { ShowMessage('Lütfen bir kelime girin!') } else { lblEnglish.Caption = txtInput.Text lblTurkish.Caption = '' backFace.Visible = False frontFace.Visible = True
MyOpenAIEngine.SendAIMessage( 'Translate the word "' + txtInput.Text + '" into Turkish. Only return the translation.' )
txtInput.Text = '' }
}
void GetAIResponse { lblTurkish.Caption = MyOpenAIEngine.NewMessageContent; backFace.Visible = False; frontFace.Visible = True; }
void FlipCard { if ( frontFace.Visible == True) { frontFace.Visible = False; backFace.Visible = True; } else { frontFace.Visible = True; backFace.Visible = False; } }
{ kelimeForm = TclForm.Create(Self); kelimeForm.clSetCaption('İngilizce → Türkçe Kart'); kelimeForm.SetFormBGImage(' https://i.imgur.com/fPwWs0H.jpeg" rel="nofollow - https://i.imgur.com/fPwWs0H.jpeg ');
txtInput = kelimeForm.AddNewProEdit(kelimeForm, 'txtInput', ''); txtInput.Align = alTop; txtInput.Margins.Top = 20; txtInput.Height = 40;
btnSorgula = kelimeForm.AddNewProButton(kelimeForm, 'btnSorgula', 'ÇEVİR'); btnSorgula.Align = alTop; btnSorgula.Height = 40; kartPanel = kelimeForm.AddNewProPanel(kelimeForm, 'kartPanel'); kartPanel.Align = alCenter; kartPanel.Width = 300; kartPanel.Height = 150; kartPanel.ClProSettings.FontColor = clAlphaColor.clHexToColor('#8f0505'); kartPanel.ClProSettings.RoundWidth = 20; kartPanel.ClProSettings.RoundHeight = 20; kartPanel.SetclProSettings(kartPanel.ClProSettings);
frontFace = kelimeForm.AddNewProPanel(kartPanel, 'frontFace'); frontFace.Align = alClient; frontFace.Visible = True; frontFace.ClProSettings.FontColor = clAlphaColor.clHexToColor('#ffffff') frontFace.SetclProSettings(frontFace.ClProSettings)
lblEnglish = kelimeForm.AddNewProLabel(frontFace, 'lblEnglish', ''); lblEnglish.Align = alCenter; lblEnglish.ClProSettings.FontSize = 20;
backFace = kelimeForm.AddNewProPanel(kartPanel, 'backFace'); backFace.Align = alClient; backFace.Visible = False; backFace.ClProSettings.FontColor = clAlphaColor.clHexToColor('#dddddd') backFace.SetclProSettings(backFace.ClProSettings)
lblTurkish = kelimeForm.AddNewProLabel(backFace, 'lblTurkish', ''); lblTurkish.Align = alCenter; lblTurkish.ClProSettings.FontSize = 20;
MyOpenAIEngine = TclOpenAIEngine.Create(Self); MyOpenAIEngine.ParentForm = kelimeForm; MyOpenAIEngine.SetToken('sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); MyOpenAIEngine.OnNewMessageEvent = 'GetAIResponse';
kelimeForm.AddNewEvent(btnSorgula, tbeOnClick, 'BtnSorgulaClick'); kelimeForm.AddNewEvent(kartPanel, tbeOnClick, 'FlipCard'); kelimeForm.Run; }
|