全网最详细中英文ChatGPT-GPT-4示例文档-TL;DR文档快速总结应用从0到1快速入门——官网推荐的48种最佳应用场景(附python/node.js/curl命令源代码,小白也能学)

news/2024/4/27 17:55:08/文章来源:https://blog.csdn.net/qq_31136513/article/details/129838473

从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快速入门,并掌握他们。

在这个AI大时代,如果不想被人颠覆,就要先颠覆别人。如果你颠覆不了别人,那你就努力运用ChatGPT提高你的技术水平和创造力。

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

说明:
0、Engine 设置定义了你要使用的模型,例如 text-davinci-003是一个文本生成模型。这种模型可以根据输入的文本,生成新的、相关的文本。
1、Max tokens是指在请求中最多允许返回的 token 数目,比如你可以指定 chatGPT 返回最多60个 token。这可以帮助你控制输出的内容大小,以便更好地控制响应速度和结果。一般1个token约4个字符或者0.75个单词
2、Temperature 是一个参数,用于控制 chatGPT 的输出。它决定了 chatGPT 在生成文本时会多么“随意”。值越高,chatGPT 生成的文本就越不可预测;值越低,chatGPT 生成的文本就越可预测。它在0.0到2.0之间,Temperature设置为0意味着ChatGPT将会生成更加保守的回复,即更少的随机性和更多的准确性,这可以帮助你在聊天中更好地控制语义,并且可以防止ChatGPT产生不相关的内容。通常建议更改此值或 Top P,但不要同时更改这两个值。
3、Top p 是随温度采样的替代方案,称为核采样,其中模型考虑具有top_p概率质量的标记的结果。因此0.1意味着仅考虑包括前10%概率质量的记号。通常建议更改此值或 temperature,但不要同时更改这两个值。
4、Frequency penalty 是指在训练时,模型会根据词频来调整每个单词的重要性。它可以帮助模型更好地理解文本,并减少过拟合。介于-2.0和2.0之间的数字。正值会根据新标记在文本中的现有频率惩罚新标记,从而降低模型逐字重复同一行的可能性。Frequency penalty设置为0意味着模型不会对重复的词进行惩罚。它可以帮助模型生成更多的新词,而不是重复使用已有的词。
5、Presence penalty 是指在ChatGPT中,一些预先定义的条件或者状态可能会影响机器人回答的质量,介于-2.0和2.0之间的数字。正值会根据新标记到目前为止是否出现在文本中来惩罚它们,从而增加模型谈论新主题的可能性。如果将 Presence penalty 设置为 0,则表示不会有任何惩罚。

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.
Tl;dr
中子星星是大质量超巨星坍缩的核心,它的总质量在10到25个太阳质量之间,如果恒星特别富含金属,可能会更大。[1]中子星是最小和密度最大的恒星,不包括黑洞和假设的白色、夸克星和奇异星。[2]中子星的半径约为10公里(6.2英里),质量约为1.4太阳质量。[3]它们是由大质量星星的超新星爆炸,加上引力坍缩,将核心压缩超过白色的密度,达到原子核的密度。
Tl;dr

Sample response 回复样本

Neutron stars are the collapsed cores of massive supergiant stars, with a radius of around 10 kilometres and a mass of 1.4 solar masses. They are formed from the supernova explosion of a massive star combined with gravitational collapse, compressing the core beyond white dwarf star density.
中子星是大质量超巨星坍缩的核心,半径约10公里,质量为1.4个太阳质量。它们是由大质量星星的超新星爆炸结合引力坍缩形成的,将核心压缩到白色密度之外。

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相关资料,希望能帮助到所有小伙伴们。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_138.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

事关ChatGPT账号封禁的强烈忠告

文 / 韩彬(微信公众号:量子论) 这两天有不少朋友加我微信(hanbin266),咨询ChatGPT账户被封了,怎么办? 我在《真实发生了,滥用这种场景,ChatGPT账号被封禁》一…

ChatGPT对测试行业的影响(附GPT使用实战展示)

引言: 时代的巨轮缓缓碾过,顺应时代才能胜者为王 文末有ChatGPT应用实战成果展示 ChatGPT之我见 测试的影响 正如上篇文章的推文所述,AI的发展让我们所有人都始料未及,就好像雨后春笋一样,各种各样的AI技术顺势而…

大学生对chatGPT的认知和使用

新一代对话式人工智能chatGPT在全球范围狂揽1亿名用户,不止于科技界破圈,更成为街头巷尾的谈资。 chatGPT能干什么? https://openai.com/blog/chatgpt/ chatGPT官网 写解决方案编写代码 说笑话 个人体验: 实用性强,相…

基于小程序制作一个ChatGPT聊天机器人

在AI技术日新月异的浪潮中,将ChatGPT与实战开发相结合,制作一个随身携带的聊天机器人,紧贴前沿的同时稳固基础。 一、前言1.1、什么是ChatGPT1.2、什么是文本完成二、API2.1、ChatGPT官网申请API所需要的key2.2、搭建API2.3、创建控制器及动作方法三、小程序3.1、页面创建3.…

使用Laf云平台,两步将ChatGPT接入微信公众号

使用Laf云平台,两步将ChatGPT接入微信公众号 最近很火的ChatGPT可以说已经满大街可见了,到处都有各种各样的体验地址,有收费的也有免费的,总之是五花八门、花里胡哨。 所以呢,最近我就在研究怎么才能方便快捷的体验到…

妈妈生了我,ChatGPT淘汰了我爸爸

当我还在老妈肚子的时候,经常听见老爸老妈讨论我该叫什么名字,那时他们争吵的火力十足,我在里面可真是干着急,但是因为不知道我是男是女,所以讨论了半天,最终也是无疾而终。 等我出生以后,老爸那…

手把手教你怎么搭建自己的ChatGPT(含源码)

这篇文章教你怎么不懂技术也可以搭建自己的chatGPT,内容都是一个字一个字的手打的,可能要错别字,需要技术支持私信老王。 提供本文你可以学到: 1、如何挑选、购买自己的服务器 2、如何注册自己的域名 3、如何安装服务器的软件…

关于ChatGPT API,你需要知道的…(截止到230303)

1. ChatGPT 的 API 已经推出 从官网 https://platform.openai.com/docs/guides/chat 和 https://platform.openai.com/docs/models/gpt-3-5 可以看出:gpt-3.5-turbo 已经正式上线。 GPT-3 快速入门:前端调用 GPT-3 API、Python 调用 GPT-3 APIopenAI 模…

零基础解读ChatGPT:对人类未来工作是威胁还是帮助?

摘要:火到现在的ChatGPT到底是什么?它背后有哪些技术?对于我们的工作和生活会有啥影响?快来一起了解吧~本文分享自华为云社区《零基础解读ChatGPT:对人类未来工作是威胁还是帮助?》,作者&#x…

「部署全流程」 中科院学术专业版chatGPT来啦

前言 上周末的时候,一位开发者将名为「ChatGPT Academic」的项目开源至 GitHub。 仅用了短短一两天,该项目 Star 数便增长到了 21k,成为 GitHub 上又一个基于 ChatGPT 构建的热门开源项目。 这个项目就是《中科院学术专业版 ChatGPT》。 …

普通用户如何在电脑和手机上极速体验最强AI——Chatgpt?

事先说明~这是我个人使用成功的方法,一时兴起从吃瓜群众变成尝鲜小白,花半天研究了点教程,踩坑上岸过后整合成的,可能会有漏洞或者写得不对的地方,欢迎有大佬交流指正!总之希望能帮助到感兴趣的友友~ 注&am…

重磅!openAI开放chatGPT模型APIgpt-3.5-turbo,成本直降90%!

ChatGPT API,千呼万唤终于来了。 chatGPT不仅开放 成本还直降90%! 全新API基于“gpt-3.5-turbo”模型,其基础是支持ChatGPT的GPT 3.5模型,取代了此前的“text-davinci-003.”。这款名为“gpt-3.5-turbo”的模型,定价…

你的好帮手,优质chatgpt镜像网站

众所周知的原因,现在国内访问chatgpt和newbing两个工具都比较困难。但是作为我们生产力提升的优质软件,我个人认为这种大语言人工智能模型帮助我们的工作是未来的一个大趋势。在这里我准备了几个好用的chatgpt免费镜像网站供大家使用。ChatGPT Bot (xeas…

Android Studio 插件 ChatGPT

一、为什么要在AS里使用ChatGPT 在AS里使用ChatGPT可以辅助生成一些重复性、解析类的代码,还有一些功能性问题查找,具体需要个人探索。官网使用经常性出现断连,需要刷新浏览器,而且经常历史列表丢失(个人是这样的&…

ChatGPT专业应用:生成外贸询盘邮件

正文共 897 字,阅读大约需要 8 分钟外贸必备技巧,您将在8分钟后获得以下超能力:生成外贸询盘邮件Beezy评级 :A级*经过寻找和一段时间的学习,一部分人能掌握。主要提升效率并增强自身技能。推荐人 | Kim编辑者 | Yoland…

Java SpringBoot实现调用OpenAI ChatGPT的相关接口(详细教程)

大纲 说明 Java调用OpenAI接口,Java调用实现ChatGPT聊天,OpenAIAPI是一个自己封装的OpenAI GPT-3聊天API的Java工具类,可用于通过Java代码调用GPT-3模型进行自然语言交互,实现智能聊天等功能。 通过调用GPT-3模型,输…

ChatGPT是如何一本正经地胡说八道的?

阅读本文大约需要5分钟 大家好,我是恩哥。 最近几天,刷屏朋友圈的只有两件事:ChatGPT横空出世,以及如何买药预防新冠。 恩哥第一时间体验了几天ChatGPT,总结下来就一句话:这个AI的聊天能力已经足以在很多…

全网最详细中英文ChatGPT-GPT-4示例文档-从0到1快速入门解析非结构化数据应用——官网推荐的48种最佳应用场景(附python/node.js/curl命令源代码,小白也能学)

从0到1快速入门解析非结构化数据应用场景Introduce 简介setting 设置Prompt 提示Sample response 回复样本API request 接口请求python接口请求示例node.js接口请求示例curl命令示例json格式示例其它资料下载ChatGPT是目前最先进的AI聊天机器人,它能够理解图片和文字…

《ChatGPT百科全书》你对ChatGPT的问题都可以在这里找到答案

我花了一周时间整理了份《ChatGPT百科全书》,里面涵盖了账号、ChatGPT小白科普、Prompt学习由浅入深、ChatGPT花式玩法、AI工具库、利用ChatGPT变现的90种方法以及最新研报等; 传送门:Docshttps://xum666e6ro.feishu.cn/docx/Sk11dgxhtoQFKd…

ChatGPT 菜鸟教程,赶快收藏~

这是个什么样教程 ? 这是一个收集整理 chatGPT 相关周边产品的使用教程,包括注册教程、入门教程、高阶玩法教程等。 为什么出这样一个教程 ? 现在 chatGPT 相关周边产品很丰富,虽然这些 AI 工具网上都有一大把教程,…