-
Notifications
You must be signed in to change notification settings - Fork 19
/
_qa.php
41 lines (29 loc) · 1.14 KB
/
_qa.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once "../OpenAI.php";
$instance = new OpenAI(secretKey: 'Bearer <API_KEY>');
$prompt = "I am a highly intelligent question answering bot. If you ask me a question that is rooted in truth, I will give you the answer. If you ask me a question that is nonsense, trickery, or has no clear answer, I will respond with \"Unknown\".
Q: What is human life expectancy in the United States?
A: Human life expectancy in the United States is 78 years.
Q: Who was president of the United States in 1955?
A: Dwight D. Eisenhower was president of the United States in 1955.
Q: Which party did he belong to?
A: He belonged to the Republican Party.
Q: What is the square root of banana?
A: Unknown
Q: How does a telescope work?
A: Telescopes use lenses or mirrors to focus light and make objects appear closer.
Q: Where were the 1992 Olympics held?
A: The 1992 Olympics were held in Barcelona, Spain.
Q: How many squigs are in a bonk?
A: Unknown
Q:";
header('Content-Type: application/json');
echo $instance->complete(
$prompt,
150,
[
"temperature" => 0.0,
"start_text" => "\nA:",
"restart_text" => "\n\nQ: "
]
);