dont have open ai api token
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/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)
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
import openai
|
||||
|
||||
prompt = """We’re releasing an API for accessing new AI models developed by OpenAI. Unlike most AI systems which are designed for one use-case, the API today provides a general-purpose “text in, text out” interface, allowing users to try it on virtually any English language task. You can now request access in order to integrate the API into your product, develop an entirely new application, or help us explore the strengths and limits of this technology."""
|
||||
|
||||
response = openai.Completion.create(model="davinci", prompt=prompt, stop="\n", temperature=0.9, max_tokens=100)
|
||||
|
||||
print(response)
|
||||
Reference in New Issue
Block a user