• 26-02-2024, 23:27:00
    #10
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Artık herkes yazar herkes coder
  • 26-02-2024, 23:30:05
    #11
    Merhaba, wp plugin yazmak istiyorum. Plugin sunişi yapacak, chatgpt apiye bağlanıp verilen başlıkta makale yazdırıp wordprese siteye ekleyecek. Birlikte yazabilirmiyiz plugini lutfen

    Sonuç fena değil gibi


    <?php
    /**
    * Plugin Name: ChatGPT Article Writer
    * Description: Connects to the ChatGPT API to generate articles based on a given title and adds them to the WordPress site.
    * Version: 1.0
    * Author: Your Name
    */

    function chatgpt_generate_article($title) {
    $api_key = 'YOUR_API_KEY';
    $prompt = "Please write a detailed article about: " . $title;
    $api_url = 'https://api.openai.com/v4/completions';

    // API'ye istek yapma
    $response = wp_remote_post($api_url, [
    'body' => json_encode([
    'model' => 'text-davinci-003', // Modeli güncelleyin
    'prompt' => $prompt,
    'temperature' => 0.7,
    'max_tokens' => 2048,
    ]),
    'headers' => [
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer ' . $api_key,
    ],
    ]);

    if (is_wp_error($response)) {
    return;
    }

    $body = wp_remote_retrieve_body($response);
    $data = json_decode($body, true);
    $article_content = $data['choices'][0]['text'];

    // WordPress'e makale ekleme
    wp_insert_post([
    'post_title' => $title,
    'post_content' => $article_content,
    'post_status' => 'publish',
    'post_author' => 1, // Yazar ID'si
    'post_category' => [2], // Kategori ID'si
    ]);
    }

    // Bu fonksiyonu tetiklemek için bir yol sağlamanız gerekecek, örneğin bir shortcode veya bir WP-Cron işi.
    ?>
  • 26-02-2024, 23:34:04
    #12
    Şuanda GPT 3.5 vasat durumda zorla GPT 4 aldırtmak için veya sistemleri hızlandırmak için böyle birşey yaptılar. Tek ben böyle düşünmüyormuşum.

    https://www.r10.net/sorum-var/399435...post1086892590
  • 26-02-2024, 23:52:22
    #13
    ben cok iyi kullaniyorum
  • 27-02-2024, 00:03:28
    #14
    Nookta adlı üyeden alıntı: mesajı görüntüle
    önce kodda ne olması gerekenlmeri notepad'e yazıyorum sonra chatgpt ye aktarıp sonunda bunu bana kod olarak.php şeklinde dök yaza dökermisin yazıyorum döktürüyor valla
    Teşekkürler hocam tekrar deneyeceğim
  • 27-02-2024, 00:16:15
    #15
    Nookta adlı üyeden alıntı: mesajı görüntüle
    üstteki eklentiyi function'a ekliyordum, sonra bunu bi eklenti haline çevir ve insanların rahat çalıştırabilmelerini sağla dedim yukardaki koda döktü bir kaç sitede denedim sonuç muhteşem.
    kesinlikle zaten bazen yanlıs yapsada uyarınca düzeltiyor o yüzden chatgpt devam
  • 27-02-2024, 00:48:19
    #16
    yukardaki kodu düzenledim basitçe . kullanmak isteyenler için

    https://dosya.co/rdyadvkassxq/chatgp...er(1).zip.html

    settings den api girilmesi lazım .

    $prompt = "Write a detailed, informative article about " . $title;
    $api_url = 'https://api.openai.com/v1/completions';

    $response = wp_remote_post($api_url, [
    'body' => json_encode([
    'model' => 'gpt-3.5-turbo-instruct', // veya güncel bir model
    'prompt' => $prompt,
    'temperature' => 0.7,
    'max_tokens' => 2048,
    'top_p' => 1,
    'frequency_penalty' => 0,
    'presence_penalty' => 0,
    ]),
    'headers' => [
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer ' . $api_key,
    ],
    'timeout' => 45, // İsteğin zaman aşımı süresi, saniye olarak.
    ]);