转载

ChatGPT插件例子 分类

通过示例将项目分类。

提问

以下是公司名单及其所属类别:

Apple、Facebook、Fedex Apple 

类别:

回答

技术 

Facebook 类别:社交媒体 

Fedex 类别:交付

API 请求

<font size="3">import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-003",
  prompt="The following is a list of companies and the categories they fall into:\n\nApple, Facebook, Fedex\n\nApple\nCategory:",
  temperature=0,
  max_tokens=64,
  top_p=1.0,
  frequency_penalty=0.0,
  presence_penalty=0.0
)</font>