Open AI GPT-3 Örnek Kod Php - Javascript - C# - Node JS

  • Technical Analysis (TA): Fiyat hareketlerindeki eğilime bakarak bir sonraki yönelimin nereye olacağını grafikler ve göstergeler üzerinden tahmin etmeye çalışmaktır.

SatoshiTURK

Programmer
Level 1 (1X)
Level 2 (2X)
Level 3 (3X)
Level 4 (4X)
Level 5 (5X)
Level 6 (6X)
Level 7 (7X)
Level 8 (8X)


0.00090355
  • 0.00000000  
  • #1
Birgün lazım olabilir arkadaşlar.
Sıcaklık ayarları incelenmeli ince ayarlar yapılmalı. takıldığınız yer olursa konu altında sorabilirsiniz.

OpenAI GPT-3 Php Örnek Kod.

PHP:
block" data-lang="php">$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.openai.com/v1/engines/davinci/completions',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "prompt": "[B]Sorgunuzu Buraya Yazacaksınız[/B]",
  "temperature": 0.3,
  "max_tokens": 64,
  "top_p": 1,
  "frequency_penalty": 0.5,
  "presence_penalty": 0
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer [B]API-KEY[/B]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OpenAI GPT-3 C# Örnek Kod
C#:
var client = new RestClient("https://api.openai.com/v1/engines/davinci/completions");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer [B]API-KEY[/B]");
request.AddParameter("application/json", "{\n  \"prompt\": \"[B]Sorgunuzu Buraya Yazacaksınız[/B]\",\n  \"temperature\": 0.3,\n  \"max_tokens\": 64,\n  \"top_p\": 1,\n  \"frequency_penalty\": 0.5,\n  \"presence_penalty\": 0\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);


OpenAI GPT-3 Jquery Örnek Kod
JavaScript:
var settings = {
  "url": "https://api.openai.com/v1/engines/davinci/completions",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer [B]API-KEY[/B]"
  },
  "data": JSON.stringify({"prompt":"[B]Sorgunuz Buraya[/B]","temperature":0.3,"max_tokens":64,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0}),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});


OpenAI GPT-3 Pyhton Örnek Kod
Python:
import http.client

conn = http.client.HTTPSConnection("api.openai.com")
payload = "{\n  \"prompt\": \"[B]Sorgunuz Buraya[/B]\",\n  \"temperature\": 0.3,\n  \"max_tokens\": 64,\n  \"top_p\": 1,\n  \"frequency_penalty\": 0.5,\n  \"presence_penalty\": 0\n}"
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer [B]API-KEY[/B]'
}
conn.request("POST", "/v1/engines/davinci/completions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))


OpenAI GPT-3 Node JS Axios Örnek Kod
JavaScript:
var axios = require('axios');
var data = JSON.stringify({"prompt":"[B]Sorgunuz Buraya[/B]","temperature":0.3,"max_tokens":64,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0});

var config = {
  method: 'post',
  url: 'https://api.openai.com/v1/engines/davinci/completions',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [B]API-KEY[/B]'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
 

Bu konudan SatoshiTURK isimli kullanıcıya 0.00000606 Bitcoin verilmiştir

Üst