Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|---|---|---|---|---|---|
Our ChatGPTAPI class facilitates seamless communication with the ChatGPT API, allowing you to retrieve data based on user queries directly within your Salesforce environment.
public with sharing class ChatGptHandler {
private static String API_KEY = 'ENTER YOUR API KEY';
public static void getData(String searchString){
String seachQueryTrimed = (searchString).trim();
Http http = new Http();
String reqBody = '{"model": "text-davinci-003","prompt":"'
+seachQueryTrimed+
'","max_tokens": 4000,"temperature": 0,'
+'"stream": false,"top_p": 0.5}';
HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.openai.com/v1/completions');
request.setMethod('POST');
request.setHeader('Authorization', 'Bearer '+ API_KEY);
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
request.setBody(reqBody);
HttpResponse response = http.send(request);
System.debug(response.getBody());
}
}
1 | Fatih | 125 |
2 | Tugbag Tamer Yilgin | 85 |
3 | suraj sati | 20 |
1 | Derya Baskol | 2695 |
2 | Osman Demirel | 1172 |
3 | Solmaz Aliyeva | 1095 |
4 | Emel Sarli | 565 |
5 | Sevilay Zencirkiran | 480 |
6 | Tugbag Tamer Yilgin | 305 |
7 | Yasin Aksu | 295 |
8 | Yeliz Celiker | 235 |
9 | Gul Kullu | 220 |
10 | Mehmet Akin | 175 |
1 | Derya Baskol | 4740 |
2 | Solmaz Aliyeva | 1935 |
3 | Osman Demirel | 1542 |
4 | Emel Sarli | 905 |
5 | Gul Kullu | 830 |
6 | Zeynep Yildiz | 725 |
7 | Mehmet Akin | 560 |
8 | Ayse Yilmaz | 490 |
9 | Tugbag Tamer Yilgin | 485 |
10 | Sevilay Zencirkiran | 480 |
1 | Engin Basturk | 25121 |
2 | Fatih | 22448 |
3 | Zehra Bulut | 20948 |
4 | ZY | 17781 |
5 | Alaattin Kokcu | 16337 |
6 | Burcu Derdiyok | 15956 |
7 | Zeynep Yildiz | 15760 |
8 | Cavidan | 15654 |
9 | Sebahattin Dalgic | 14951 |
10 | Ozlem Helva | 14923 |
11 | Esra Balci | 14668 |
12 | Ada Lozzy | 14470 |
13 | Bahar Erdagi | 13911 |
14 | Derya Baskol | 13455 |
15 | Mehmet Y | 12859 |
16 | Hakan Can | 12517 |
17 | Okan Ozcelik | 12088 |
18 | Yavuz Bulent | 11706 |
19 | Asli Kucukyazici | 11266 |
20 | Ayşegül Şahin | 10572 |