从0到1快速入门TL;DR文档快速总结应用场景
- Introduce 简介
- setting 设置
- Prompt 提示
- Sample response 回复样本
- API request 接口请求
- python接口请求示例
- node.js接口请求示例
- curl命令示例
- json格式示例
- 其它资料下载
ChatGPT是目前最先进的AI聊天机器人,它能够理解图片和文字,生成流畅和有趣的回答。如果你想跟上AI时代的潮流,你一定要学会使用ChatGPT。如果你想了解OpenAI最新发布的GPT-4模型,以及它如何为ChatGPT聊天机器人带来更强大的功能,那么你一定不要错过OpenAI官网推荐的48种最佳应用场景,不管你是资深开发者、初学者,你都能够从0到1快速入门,并掌握他们。
TL;DR即,Too Long; Didn’t Read “太长;“没读过”,用来总结一篇很长的文本或文章。它通常用于互联网上,当人们想快速了解一篇文章的内容而不需要阅读所有内容时。ChatGPT强大的语言快速处理能力,就能为您完成这个需求。它不仅可以帮助您节省时间和精力,还可以帮助您更好地理解文章的内容。
Introduce 简介
TL;DR summarization TL;DR总结
Summarize text by adding a ‘tl;dr:’ to the end of a text passage. It shows that the API understands how to perform a number of tasks with no instructions.
通过添加’tl;dr:“到一段文字的结尾。它表明API理解如何在没有指令的情况下执行大量任务。
setting 设置
Engine
:text-davinci-003
Max tokens
:60
Temperature
:0.7
Top p
:1.0
Frequency penalty
:0.0
Presence penalty
:1.0
Prompt 提示
Sample response 回复样本
API request 接口请求
python接口请求示例
import os
import openaiopenai.api_key = os.getenv("OPENAI_API_KEY")response = openai.Completion.create(model="text-davinci-003",prompt="A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich.[1] Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.[3] They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei.\n\nTl;dr",temperature=0.7,max_tokens=60,top_p=1.0,frequency_penalty=0.0,presence_penalty=1
)
node.js接口请求示例
const { Configuration, OpenAIApi } = require("openai");const configuration = new Configuration({apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);const response = await openai.createCompletion({model: "text-davinci-003",prompt: "A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich.[1] Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.[3] They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei.\n\nTl;dr",temperature: 0.7,max_tokens: 60,top_p: 1.0,frequency_penalty: 0.0,presence_penalty: 1,
});
curl命令示例
curl https://api.openai.com/v1/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer $OPENAI_API_KEY" \-d '{"model": "text-davinci-003","prompt": "A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich.[1] Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.[3] They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei.\n\nTl;dr","temperature": 0.7,"max_tokens": 60,"top_p": 1.0,"frequency_penalty": 0.0,"presence_penalty": 1
}'
json格式示例
{"model": "text-davinci-003","prompt": "A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich.[1] Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.[3] They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei.\n\nTl;dr","temperature": 0.7,"max_tokens": 60,"top_p": 1.0,"frequency_penalty": 0.0,"presence_penalty": 1
}
其它资料下载
如果大家想继续了解人工智能相关学习路线和知识体系,欢迎大家翻阅我的另外一篇博客《重磅 | 完备的人工智能AI 学习——基础知识学习路线,所有资料免关注免套路直接网盘下载》
这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。
本文链接:https://my.lmcjl.com/post/6745.html
4 评论