26 lines
754 B
Python
Executable File
26 lines
754 B
Python
Executable File
#!/usr/bin/env python
|
|
import openai
|
|
stop = "\n"
|
|
|
|
prompt = """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: What party did he belong to?
|
|
A: He belonged to the Republican Party.
|
|
|
|
Q: Who was president of the United States before George W. Bush?
|
|
A: Bill Clinton was president of the United States before George W. Bush.
|
|
|
|
Q: Who won the World Series in 1995?
|
|
A: The Atlanta Braves won the World Series in 1995.
|
|
|
|
Q: What year was the first fax sent?
|
|
A:"""
|
|
|
|
response = openai.Completion.create(model="davinci", prompt=prompt, stop=stop, temperature=0)
|
|
|
|
print(response)
|