Skip to main content

OpenAI::Completions - OpenAI Completions scraper

img

Scraper Overview

Overview: customization

The OpenAI Completions scraper. A scraper for the Completions method from OpenAI. It is based on the official API and uses an API key. Similar to the OpenAI::ChatGPTOpenAI::ChatGPT scraper, the main difference is the absence of the System prompt content option and other model types for generation.

A-Parser functionality allows you to save Google scraper parsing settings for future use (presets), set a parsing schedule, and much more. You can use automatic query multiplication, substitution of subqueries from files, iteration over alphanumeric combinations and lists to obtain the maximum possible number of results.

Saving results is possible in the form and structure you need, thanks to the built-in powerful templating engine Template Toolkit which allows you to apply additional logic to the results and output data in various formats, including JSON, SQL, and CSV.

Collected Data

  • Response from OpenAI
  • Number of tokens used

Capabilities

  • Scrape response from OpenAI

Use Cases

  • Generating responses from OpenAI to any questions

Queries

As queries, you need to specify the text in one line, for example:

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

Query Substitutions

You can use built-in macros for query multiplication.

In the query format, we will specify the iteration of characters from a to zzzz, this method allows you to maximally rotate the search output and get many new unique results:

$query {az:a:zzzz}

This macro will create 475254 additional queries for each original search query, which in total will give 4 x 475254 = 1901016 search queries, an impressive figure, but this is not a problem for A-Parser. At a speed of 2000 queries per minute, such a task will be processed in just 16 hours.

Output Results Examples

A-Parser supports flexible result formatting thanks to the built-in templating engine Template Toolkit, which allows it to output results in any form, as well as in structured formats, for example, CSV or JSON

Default Output

Result format:

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

Example of result:

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.

Possible Settings

ParameterDefault ValueDescription
API-keyAPI key. You can specify several (one per line), for each attempt the key will be randomly selected from the available and not used within the current request.
Model nametext-davinci-003Model type (text-davinci-003 / text-davinci-002 / text-curie-001 / text-babbage-001 / text-ada-001)
Temperature0.7Temperature
Top P1Top P
Maximum length256Maximum number of tokens used
Presence penalty0Presence penalty
Frequency penalty0Frequency penalty