ChatGPT API Transition Guide
ChatGPT API Transition Guide

Prompts to Messages
To have a more interactive and dynamic conversation with our models, you can use messages in ChatGPT instead of the old prompt-style using with completions.
Here's how it works:
Instead of sending a single string as your prompt, you send a list of messages as your input.
Each message in the list has two properties: role and content.
The 'role' can take one of three values: 'system', 'user' or the 'assistant'
The 'content' contains the text of the message from the role.
The system instruction can give high level instructions for the conversation
The messages are processed in the order they appear in the list, and the assistant responds accordingly.
Even basic Completions requests can be completed through ChatGPT, as you can see below:
Then |
Now |
|
|
Now, it is easier than ever to have back-and-forths with your model by just by extending the list of messages in the conversation.
'messages': [{'role':'user', 'content':'tell me a joke'},
{'role':'assistant', 'content':'why did the chicken cross the road'},
{'role':'user', 'content':'I don't know, why did the chicken cross the road'}]
System Instructions
You can also use a system level instruction to guide your model's behavior throughout the conversation. For example, using a system instruction and a message like this
'messages': [{'role':'system', 'content':'You are an assistant that speaks like Shakespeare.'},
{'role':'user', 'content':'tell me a joke'},
will result in something like
{...
'message': {'role':'assistant',
'content':'Why did the chicken cross the road? To get to the other side, but verily, the other side was full of peril and danger, so it quickly returned from whence it came, forsooth!'}
...}
ChatGPT API Transition Guide的更多相关文章
- iOS 7 UI 过渡指南 - 支持续 iOS 6(iOS 7 UI Transition Guide - Supporting iOS 6)
iOS 7 UI Transition Guide Preparing for Transition Before You Start Scoping the Project Supporting i ...
- iOS 7 UI 过渡指南 - 開始之前(iOS 7 UI Transition Guide - Before You Start)
iOS 7 UI Transition Guide Preparing for Transition Before You Start Scoping the Project Supporting i ...
- IOS7 UI Transition Guide 状态栏 statusbar
本文转载至 http://blog.csdn.net/linzhiji/article/details/12233387 Redesign Your App for iOS 7 之 页面布局 iOS7 ...
- ChatGPT API使用介绍
1.概述 随着人工智能技术的不断发展,越来越多的AI产品被应用到各个领域,其中最具代表性的莫过于人工智能语言模型.语言模型是一种可以通过学习大量语言数据来预测文本或语音的技术,其应用范围十分广泛,如智 ...
- OpenTranslator:一款基于ChatGPT API的翻译神器
这是一款使用 ChatGPT API 进行划词翻译和文本润色的浏览器插件.借助了 ChatGPT 强大的翻译能力,它将帮助您更流畅地阅读外语和编辑外语. 它能干啥 一. 可翻译 二. 可润色 三. 可 ...
- ChatGPT API接口编程基础与使用技巧
总结/朱季谦 趁着这周末空闲时间,在研读完OpenAi官网文档的基础上,及时总结了这篇<ChatGPT API接口编程基础与使用技巧>. 本文大部分内容是围绕编程方面,包括ChatGPT模 ...
- Ehcache(2.9.x) - API Developer Guide, Key Classes and Methods
About the Key Classes Ehcache consists of a CacheManager, which manages logical data sets represente ...
- Ehcache(2.9.x) - API Developer Guide, Write-Through and Write-Behind Caches
About Write-Through and Write-Behind Caches Write-through caching is a caching pattern where writes ...
- Ehcache(2.9.x) - API Developer Guide, Cache Eviction Algorithms
About Cache Eviction Algorithms A cache eviction algorithm is a way of deciding which element to evi ...
- 两条命令搞定 ChatGPT API 的调用问题
自2022年11月30日 OpenAI 发布 ChatGPT 以来,虽然时有唱衰的声音出现,但在OpenAI不断推陈出新,陆续发布了OpenAPI.GPT-4.ChatGPT Plugins之后,似乎 ...
随机推荐
- 3. IOC相关内容
1. bean 相关配置 对于 bean 的配置中,主要会讲解bean基础配置,bean的别名配置,bean的作用范围配置(重点),这三部分内容: 1.1 bean 基础配置(id 与 c ...
- 每日一题力扣 1262 https://leetcode.cn/problems/greatest-sum-divisible-by-three/
. 题解 这道题目核心就算是要知道如果x%3=2的话,应该要去拿%3=1的数字,这样子才能满足%3=0 贪心 sum不够%3的时候,就减去余数为1的或者余数为2的 需要注意 两个余数为1会变成余数为2 ...
- BOM和DOM相关API
一.DOM相关API 1. DOM API DOM(Document Object Model)文档对象模型得树形结构 文档对象模型就是一个树形结构,类似于家谱树 html标签里面包裹了所有的文档内容 ...
- (占坑编辑中)hexo博客github page更换域名
hexo博客github page更换域名 檗科下的Cname文件一定要改为最近的域名
- [Spring+SpringMVC+Mybatis]框架学习笔记(六):Spring_AspectJ实现AOP
第6章 Spring_AspectJ实现AOP 6.1 什么是AspectJ 对于AOP的这种编程思想,有很多框架或者组件进行了实现,spring实现AOP就是其中的一种. AspectJ也实现了AO ...
- C语言基础--字符串
文章目录 前言 一.数组 1.一维数组的创建 2.数组的索引 3.数组的调用 3.1 单个输出 3.2多个输出 二.字符串的创建 1.字符串的创建 2.字符串的输出 三.总结 前言 C语言中,有整型. ...
- 关于在modelsim中 仿真 ROM IP核 读取不了 mif文件 的解决方法
在modelsim中 仿真 ROM IP核 读取不了 mif文件 . 出现状况: 显示无法打开 rom_8x256.mif 文件 .点开modelsim下面文件的内存列表,可看到内存全为0. 查看自身 ...
- pandas 根据列的值选取所有行
原文链接:https://blog.csdn.net/changzoe/article/details/82348913 在其他论坛上看到的,原文链接如上所示.为方便记忆,原文如下所示: 选取等于某些 ...
- 带你走进数仓大集群内幕丨详解关于作业hang及残留问题定位
本文分享自华为云社区<[带你走进DWS大集群内幕]大集群通信:作业hang.残留问题定位>,作者: 雨落天穹丶. 前言: 测试过程中,我们会遇到这样一种情况,我的作业都执行很久了,为啥还不 ...
- grub加密与解密
前言 grub默认无加密,用户可免密以单用户模式进入系统修改root密码.若想增强其安全性,可以将grub加密. GRUB2提供两种类型的密码保护: 修改菜单条目时需要密码,但启动菜单条目时不需要密码 ...