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.0.9
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

openai-text-completions This package allows you to generate text completions using the OpenAI API from the command line.

Prerequisites Node.js (version 8.0 or higher) An OpenAI API key (sign up for one here) Installation To install the openai-text-completions package globally:

Copy code npm install -g openai-text-completions Usage Set the API key Before you can use the openai-text-completions command, you need to set your API key. To do this, use the key command followed by your API key:

Copy code openai-text-completions key YOUR_API_KEY Generate text completions To generate text completions, use the completions command followed by the prompt argument:

Copy code openai-text-completions completions "The quick brown fox" The prompt argument should be surrounded by quotes to ensure that it is interpreted as a single string.

By default, the completions command uses the text-davinci-002 model and a temperature of 0.5. You can modify these settings by passing additional options to the completions command. For example:

Copy code openai-text-completions completions "The quick brown fox" --model "text-davinci-002" --temperature 0.5 Check the API key To check if the API key has been set, use the check-key command:

Copy code openai-text-completions check-key If the API key has been set, this command will output API key is set.. If the API key has not been set or is invalid, this command will output an error message.

License This package is licensed under the MIT License. See the LICENSE file

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