Sayfayı Yazdır | Pencereyi Kapat

tclOpenAIengine hatası

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Genel İşlemler
Forum Tanımlaması: TRObject dili ile programlama yaparken karşılaşılan genel işlemler
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1106
Tarih: 18 Temmuz 2025 Saat 19:59
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: tclOpenAIengine hatası
Mesajı Yazan: dilarayaprak
Konu: tclOpenAIengine hatası
Mesaj Tarihi: 18 Temmuz 2025 Saat 14:38
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;
}



Cevaplar:
Mesajı Yazan: Sudesigirci
Mesaj Tarihi: 18 Temmuz 2025 Saat 14:58
Merhaba dilara,
TclOpenAIEngine bileşeninin güncellenmesi gerekiyor bunun yerine TclRest bileşenini kullanarak projene yapay zeka entegre edebilirsin

Detaylıca incelemen için :
https://www.docs.clomosy.com/index.php?title=TclRest" rel="nofollow - https://www.docs.clomosy.com/index.php?title=TclRest

İyi Çalışmalar Dilerim



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net