
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@gpt-mind/prompts
Advanced tools
This repository contains a collection of prompts for the GPT-3 API.
npm install @gpt-mind/prompts
const prompts = require('@gpt-mind/prompts');
const definition = prompts.getPromptDefinition(prompts.meaningOfStatement);
const params = {
statement: 'The sky is blue.',
};
if (definition.validate(params)) {
const completedPrompt = await definition.complete(params, apiKey);
console.log(definition.replace(params) + completedPrompt);
}
function getPromptDefinition(prompt: string): PromptDefinition
This function gets the prompt definition object based on a given prompt string. It extracts replacement tokens from the prompt string, and creates an object with properties for prompt, params, validate, replace, and complete.
The validate property checks if all required parameters are present in the params object. The replace property replaces all replacement tokens in the prompt string with their corresponding values from the params object. The complete property uses an OpenAI API to complete the given prompt with a valid response.
prompt - A string representing the prompt to generate the prompt definition object for. Return Value Returns an object of type PromptDefinition which contains the following properties:
A string representing the original prompt.
A function that validates the params object to make sure all required params are present. It takes one parameter:
A function that replaces all replacement tokens in the prompt string with their corresponding values from the params object. It takes one parameter:
A function that uses the OpenAI API to complete the given prompt with a valid response. It takes three parameters:
const apiKey = 'my-api-key';
const prompt = 'My name is {{name}} and I like {{food}}.';
const params = { name: 'John', food: 'pizza' };
const promptDefinition = getPromptDefinition(prompt);
if (promptDefinition.validate(params)) {
const completedPrompt = await promptDefinition.complete(params, apiKey);
console.log(promptDefinition.replace(params) + completedPrompt);
}
Contributions are welcome! Please see CONTRIBUTING.md for more information.
FAQs
A collection of prompts for the gpt-mind library
The npm package @gpt-mind/prompts receives a total of 2 weekly downloads. As such, @gpt-mind/prompts popularity was classified as not popular.
We found that @gpt-mind/prompts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.