New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openai-text-completions

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openai-text-completions

A global npm package for generating text completions using the OpenAI API

1.1.16
latest
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

openai-text-completions

A Node.js module for interacting with the OpenAI text completion API.

Installation

npm install openai-text-completions

Usage

First, you'll need to obtain an API key from OpenAI. Once you have your key, you can set it using the key command:

openai-text-completions key <your-api-key>

You can then check that your key is valid using the check-key command:

openai-text-completions check-key

To generate text, you can use the generate or generate-from-file commands. The generate command takes a string prompt as its first argument, and the generate-from-file command takes a path to a file containing the prompt as its first argument. Both commands also accept an optional model argument (default: text-davinci-002) and an optional temperature argument (default: 0.5).

Here's an example of using the generate command:

openai-text-completions generate "The quick brown fox jumps over the lazy dog."

And here's an example of using the generate-from-file command:

openai-text-completions generate-from-file prompt.txt

License

MIT

FAQs

Package last updated on 26 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts