× WhatsApp Icon

शासकीय माहिती आणि योजना WhatsApp ग्रुप⚡जॉईन करा!

जॉईन करा
Home अकोला अमरावती गडचिरोली गोंदिया चंद्रपूर नागपूर बुलढाणा भंडारा यवतमाळ वर्धा वाशीम उस्मानाबाद औरंगाबाद जालना नांदेड परभणी बीड लातूर हिंगोली अहमदनगर कोल्हापूर पुणे सांगली सातारा सोलापूर जळगाव धुळे नंदुरबार नाशिक ठाणे पालघर मुंबई शहर व उपनगर रत्नागिरी रायगड सिंधुदुर्ग
// Function to generate hashtags using Gemini API with prompt function geneatename($prompt, $input, $apiKey) { $url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key={$apiKey}"; $postData = json_encode([ "contents" => [ [ "parts" => [ ["text" => $prompt . ' ' . $input] // Combine prompt and input ] ] ], "generationConfig" => [ "temperature" => 0.9, "topK" => 1, "topP" => 1, "maxOutputTokens" => 1500, // Adjust as necessary "stopSequences" => [] ], "safetySettings" => [ [ "category" => "HARM_CATEGORY_HARASSMENT", "threshold" => "BLOCK_ONLY_HIGH" ], [ "category" => "HARM_CATEGORY_HATE_SPEECH", "threshold" => "BLOCK_ONLY_HIGH" ], [ "category" => "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold" => "BLOCK_ONLY_HIGH" ], [ "category" => "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold" => "BLOCK_ONLY_HIGH" ] ] ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Content-Length: ' . strlen($postData) ]); $response = curl_exec($ch); curl_close($ch); $responseData = json_decode($response, true); if (isset($responseData['candidates'][0]['content']['parts'][0]['text'])) { return $responseData['candidates'][0]['content']['parts'][0]['text']; } else { return "No generated hashtags found."; } } add_action('wp_ajax_generate_name_json', 'generate_name_json'); add_action('wp_ajax_nopriv_generate_name_json', 'generate_name_json'); function generate_name_json() { if ($_SERVER['REQUEST_METHOD'] === 'POST') { $videoInput = isset($_POST['videoInput']) ? $_POST['videoInput'] : ''; $numHashtags = isset($_POST['numHashtags']) ? intval($_POST['numHashtags']) : 30; // Default to 30 if not provided $prompt = 'I Want You To Work As A Youtube Seo Expert Who Knowes Everything About Youtube Seo. My Main Gole Is To Rank Or Virel My Youtube Video About The Topic I Am Going To Give You. So You Have To Generate The Best Treanding Hastags For The Topic Generate A Minimum ' . $numHashtags . ' Hastags, Generate higly related highquality hastags that related to the topic or title. This Is Most Important To Not Add Any Other Unwanted Text Or Characters As It Breaks The Flow And Only Generates Hashtags. and generate the Hastags In JSON Formet Like The Example { "hashtags": [ { "hashtag": "#WebDevelopment" }, { "hashtag": "#WebDevelopmentPodcast" }, { "hashtag": "#WebDevelopmentCareer" } ] } gnerate the output same as i said dont add or remove anything like (```json) . Now Generate ' . $numHashtags . ' hashtags For:'; // Your prompt $geminiApiKey = 'YOUR_API_KEY'; $description = geneatename($prompt, $videoInput, $geminiApiKey); // Return the generated description as JSON echo json_encode(['description' => $description]); exit; } } function hashtags_generator() { ob_start(); ?>

---Advertisement---

LATEST Post

Close Visit Havaman Andaj