OpenAI API In Action All In One

OpenAI API In Action All In One

Build next-gen apps with OpenAI’s powerful models.
Access GPT-3, which performs a variety of natural language tasks, Codex, which translates natural language to code, and DALL·E, which creates and edits original images.

构建下一代应用程序 OpenAI 的强大模型。
访问执行各种自然语言任务的 GPT-3、将自然语言翻译成代码的 Codex 以及创建和编辑原始图像的 DALL·E

https://openai.com/api/

import openai

openai.Completion.create(
  engine="davinci",
  prompt="Make a list of astronomical observatories:"
)

https://beta.openai.com/docs/

image

Guides

Text completion
Learn how to generate or edit text using our models

Code completionLimited beta
Learn how to generate, edit, or explain code

Image generationBeta
Learn how to generate or edit images

Fine-tuning
Learn how to train a model for your use case

Embeddings
Learn how to search, classify, and compare text

文本补全
了解如何使用我们的模型生成或编辑文本

代码补全有限测试版
了解如何生成编辑解释代码 ✅

图像生成测试版
了解如何生成或编辑图像

微调
了解如何为您的用例训练模型

嵌入
了解如何搜索、分类和比较文本

Examples

Q&A
Answer questions based on existing knowledge.
Grammar correction
Corrects sentences into standard English.
Summarize for a 2nd grader
Translates difficult text into simpler concepts.
Natural language to OpenAI API
Create code to call to the OpenAI API using a natural language instruction.
Text to command
Translate text into programmatic commands.
English to other languages
Translates English text into French, Spanish and Japanese.
Natural language to Stripe API
Create code to call the Stripe API using natural language.
SQL translate
Translate natural language to SQL queries.
Parse unstructured data
Create tables from long form text
Classification
Classify items into categories via example.
Python to natural language
Explain a piece of Python code in human understandable language.
Movie to Emoji
Convert movie titles into emoji.
Calculate Time Complexity
Find the time complexity of a function.
Translate programming languages
Translate from one programming language to another
Advanced tweet classifier
Advanced sentiment detection for a piece of text.
Explain code
Explain a complicated piece of code.
Keywords
Extract keywords from a block of text.
Factual answering
Guide the model towards factual answering by showing it how to respond to questions that fall outside its knowledge base. Using a '?' to indicate a response to words and phrases that it doesn't know provides a natural response that seems to work better than more abstract replies.
Ad from product description
Turn a product description into ad copy.
Product name generator
Create product names from examples words. Influenced by a community prompt.
TL;DR summarization
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.
Python bug fixer
Find and fix bugs in source code.
Spreadsheet creator
Create spreadsheets of various kinds of data. It's a long prompt but very versatile. Output can be copy+pasted into a text file and saved as a .csv with pipe separators.
JavaScript helper chatbot
Message-style bot that answers JavaScript questions
ML/AI language model tutor
Bot that answers questions about language models
Science fiction book list maker
Create a list of items for a given topic.
Tweet classifier
Basic sentiment detection for a piece of text.
Airport code extractor
Extract airport codes from text.
SQL request
Create simple SQL queries.
Extract contact information
Extract contact information from a block of text.
JavaScript to Python
Convert simple JavaScript expressions into Python.
Friend chat
Emulate a text message conversation.
Mood to color
Turn a text description into a color.
Write a Python docstring
An example of how to create a docstring for a given Python function. We specify the Python version, paste in the code, and then ask within a comment for a docstring, and give a characteristic beginning of a docstring (""").
Analogy maker
Create analogies. Modified from a community prompt to require fewer examples.
JavaScript one line function
Turn a JavaScript function into a one liner.
Micro horror story creator
Creates two to three sentence short horror stories from a topic input.
Third-person converter
Converts first-person POV to the third-person. This is modified from a community prompt to use fewer examples.
Notes to summary
Turn meeting notes into a summary.
VR fitness idea generator
Create ideas for fitness and virtual reality games.
ESRB rating
Categorize text based upon ESRB ratings.
Essay outline
Generate an outline for a research topic.
Recipe creator (eat at your own risk)
Create a recipe from a list of ingredients.
Chat
Open ended conversation with an AI assistant.
Marv the sarcastic chat bot
Marv is a factual chatbot that is also sarcastic.
Turn by turn directions
Convert natural language to turn-by-turn directions.
Restaurant review creator
Turn a few words into a restaurant review.
Create study notes
Provide a topic and get study notes.
Interview questions
Create interview questions.

问答
根据现有知识回答问题。
语法修正
将句子改成标准英语。
给二年级学生总结
将困难的文本翻译成更简单的概念。
自然语言到 OpenAI API
创建代码以使用自然语言指令调用 OpenAI API。
命令文本
将文本转换为编程命令。
英语到其他语言
将英文文本翻译成法文、西班牙文和日文。
Stripe API 的自然语言
创建代码以使用自然语言调用 Stripe API。
SQL翻译
将自然语言翻译成 SQL 查询。
解析非结构化数据
从长格式文本创建表格
分类
通过示例将项目分类。
Python 到自然语言
用人类可以理解的语言解释一段 Python 代码。
电影到表情符号
将电影片名转换为表情符号。
计算时间复杂度
找出函数的时间复杂度。
翻译编程语言
从一种编程语言翻译成另一种
高级推文分类器
一段文本的高级情感检测。
解释代码
解释一段复杂的代码。
关键字
从文本块中提取关键字。
如实回答
通过向模型展示如何回答超出其知识库范围的问题,引导模型做出事实性回答。 用一个 '?' 指示对它不知道的单词和短语的响应提供了一种自然的响应,似乎比更抽象的答复更有效。
产品说明中的广告
将产品说明变成广告文案。
产品名称生成器
从示例单词创建产品名称。 受社区提示的影响。
TL;DR 总结
通过在文本段落的末尾添加“tl;dr:”来总结文本。 它表明 API 了解如何在没有指令的情况下执行许多任务。
Python错误修复程序
查找并修复源代码中的错误。
电子表格创建者
创建各种数据的电子表格。 这是一个很长的提示符,但用途广泛。 可以将输出复制并粘贴到文本文件中,并另存为带有竖线分隔符的 .csv 文件。
JavaScript 助手聊天机器人
回答 JavaScript 问题的消息式机器人
ML/AI语言模型导师
回答有关语言模型问题的机器人
科幻书单制作工具
为给定主题创建项目列表。
推文分类器
一段文本的基本情感检测。
机场代码提取器
从文本中提取机场代码。
SQL请求
创建简单的 SQL 查询。
提取联系信息
从文本块中提取联系信息。
JavaScript 到 Python
将简单的 JavaScript 表达式转换为 Python。
好友聊天
模拟短信对话。
心情变色
将文字描述变成一种颜色。
编写 Python 文档字符串
如何为给定的 Python 函数创建文档字符串的示例。 我们指定 Python 版本,粘贴代码,然后在注释中询问文档字符串,并给出文档字符串的特征开头 (""")。
类比制造商
创建类比。 从社区提示修改为需要更少的示例。
JavaScript 一行函数
将一个 JavaScript 函数变成一个单行代码。
微型恐怖故事创作者
根据主题输入创建两到三句话的简短恐怖故事。
第三人称转换器
将第一人称 POV 转换为第三人称。 这是根据社区提示修改的,以使用更少的示例。
总结说明
将会议记录变成摘要。
VR健身创意生成器
为健身和虚拟现实游戏创造创意。
ESRB评级
根据 ESRB 评级对文本进行分类。
论文大纲
为研究主题生成大纲。
食谱创作者(风险自负)
根据成分列表创建食谱。
聊天
与 AI 助手的开放式对话。
Marv 讽刺聊天机器人
Marv 是一个基于事实的聊天机器人,同时也很讽刺。
转弯方向
将自然语言转换为逐向指示。
餐厅评论创建者
将几句话变成餐厅评论。
创建学习笔记
提供主题并获取学习笔记。
面试题
创建面试问题。

https://beta.openai.com/examples

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章