跳转到主要内容

OpenAI::Completions - OpenAI Completions 爬虫工具

img

爬虫工具概览

爬虫工具概览:设置

OpenAI Completions 爬虫工具。基于 OpenAI 的 Completions 方法。根据官方 API开发并使用 API 密钥。类似于 OpenAI::ChatGPTOpenAI::ChatGPT 爬虫工具,主要区别在于没有 System prompt content 选项,并使用其他类型的模型进行生成。

A-Parser 的功能允许保存此爬虫工具的抓取设置以便后续使用(预设),设置抓取计划等等。您可以使用自动查询扩展、从文件中替换子查询、遍历数字字母组合和列表,以获取尽可能多的结果。

由于内置了强大的模板引擎 Template Toolkit,可以按您需要的形式和结构保存结果,该引擎允许对结果应用额外的逻辑,并以各种格式输出数据,包括 JSON、SQL 和 CSV

采集数据

  • 来自 OpenAI 的回答
  • 已使用的令牌(Tokens)数量

功能

  • 抓取来自 OpenAI 的回答

应用场景

  • 针对任何问题生成 OpenAI 回答

查询

查询必须以单行文本形式指定,例如:

What are 5 key points I should know when studying Ancient Rome?

查询占位符

您可以使用 内置宏 来扩展查询。

在查询格式中,我们可以指定从 a 到 zzzz 的字符遍历,这种方法可以最大限度地轮换搜索结果并获取大量新的唯一结果:

$query {az:a:zzzz}

该宏将为每个原始搜索查询创建 475254 个额外查询,总计将产生 4 x 475254 = 1901016 个搜索查询。这个数字虽然惊人,但对于 A-Parser 来说完全不是问题。在每分钟 2000 次查询的速度下,此类任务仅需 16 小时即可处理完毕。

结果输出示例

得益于内置的模板引擎 Template Toolkit,A-Parser 支持灵活的结果格式化,这使其能够以任意形式以及结构化形式(如 CSV 或 JSON)输出结果。

默认输出

结果格式:

Used tokens: $total_tokens, Answer:\n$answer\n

结果示例:

Used tokens: 290, Answer:
1. Founding and Early History: Ancient Rome was founded in 753 BCE by twin brothers Romulus and Remus. The city grew to become one of the most powerful and influential empires in world history.
2. Roman Republic: The Roman Republic was established in 509 BCE and lasted until 27 BCE. During this time, Rome developed a complex system of government, with two consuls elected annually, a senate, and assemblies of citizens.
3. Roman Empire: The Roman Empire began in 27 BCE when Augustus became the first Roman emperor. The empire grew to include much of Europe, the Middle East, and North Africa and lasted until the fall of the Western Roman Empire in 476 CE.
4. Achievements and Contributions: Ancient Rome made significant contributions to architecture, engineering, law, philosophy, art, literature, and language. Roman innovations include the arch, concrete, aqueducts, roads, and the Latin alphabet.
5. Decline and Fall: The Roman Empire faced numerous challenges, including economic instability, political corruption, military defeats, and invasions by barbarian tribes. The Western Roman Empire fell in 476 CE, while the Eastern Roman Empire (Byzantine Empire) survived until 1453 CE.

可选设置

参数默认值描述
API domainapi.openai.com可以修改 API 请求的域名
API keyAPI 密钥。可以指定多个(每行一个),对于每次尝试,将从当前查询中可用且未使用的密钥中随机选择。
Model nametext-davinci-003模型类型 (gpt-3.5-turbo-instruct / babbage-002 / davinci-002 / text-davinci-003)
Temperature0.7Temperature
Top P1Top P
Maximum length256使用的最大令牌数量
Presence penalty0Presence penalty
Frequency penalty0Frequency penalty