GPT-3|GPT-3 Python API试用
试用了一下Idea generation功能,示例代码如下:
import openai
openai.api_key = "***"
response = openai.Completion.create(
engine="davinci",
prompt="Blog topics dealing with daily life living on Mars\r\n1.",
temperature=0.3,
top_p=1,
frequency_penalty=0.5,
presence_penalty=0.8,
best_of=1,
max_tokens=64)
【GPT-3|GPT-3 Python API试用】response内容如下:
{
"choices": [
{
"finish_reason": "length",
"index": 0,
"logprobs": null,
"text": " What is the best way to eat on Mars?\n2. What are the best ways to get around on Mars?\n3. How do you make a house on Mars?\n4. How do you make clothes for Mars?\n5. How do you grow food on Mars?\n6. What kind of"
}
],
"created": 1615435342,
"id": "cmpl-2c6ogBbdrKYgVQdfEnnuASp3ZrI3y",
"model": "davinci:2020-05-03",
"object": "text_completion"
}
推荐阅读
- 2020-04-07vue中Axios的封装和API接口的管理
- python学习之|python学习之 实现QQ自动发送消息
- 逻辑回归的理解与python示例
- python自定义封装带颜色的logging模块
- 【Leetcode/Python】001-Two|【Leetcode/Python】001-Two Sum
- Python基础|Python基础 - 练习1
- Python爬虫|Python爬虫 --- 1.4 正则表达式(re库)
- Python(pathlib模块)
- python青少年编程比赛_第十一届蓝桥杯大赛青少年创意编程组比赛细则
- Python数据分析(一)(Matplotlib使用)