Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
chatgpt-plus-unofficial-client
Advanced tools
Readme
This is a Node.js Open Source project for making API calls to ChatGPT. The project uses the paid version of ChatGPT (AKA ChatGPT Plus), making it easier to use without having to worry about the limitations of the free version.
To install the project, run the following command in your terminal:
npm install chatgpt-plus-api-client
To make API calls to ChatGPT in TypeScript, use the following code in your project:
import { sendPostRequest } from "chatgpt-plus-api-client";
async function talk() {
let conversationId, parentMessageId;
let response = await sendPostRequest({
prompt: "for loop in js?",
});
parentMessageId = response.message.id;
conversationId = response.conversation_id;
console.log(response.message.content.parts[0]);
response = await sendPostRequest({
prompt: "rewrite it in typescript",
parentMessageId,
conversationId,
});
parentMessageId = response.message.id;
console.log(response.message.content.parts[0]);
}
talk();
By default, the API client uses the Default model. There are 3 available models to choose from:
Default
Legacy
gpt-4
To choose a different model, simply pass in the model option in the sendPostRequest function, like so:
async function talk() {
const response = await sendPostRequest({
prompt: "for loop in js?",
model: "Legacy",
});
console.log(response.message.content.parts[0]);
}
talk();
async function talk() {
const response = await sendPostRequest({
prompt: `[Text from :https://medium.com/@anchen.li/creating-custom-shortcuts-on-your-mac-to-check-grammar-using-chatgpt-809c78715eda]
What is the article about?`,
model: "gpt-4",
});
console.log(response.message.content.parts[0]);
}
talk();
Before using the API client, you must set the CHATGPT_COOKIES and CHATGPT_AUTH_TOKEN environment variables. These values can be obtained by manually copying the cookies and authentication token from your browser requests.
_puid
cookie.CHATGPT_COOKIES
environment variable to the string _puid=[value]
.Note that these steps are specific to Google Chrome. If you are using a different web browser, the process for retrieving cookies may be slightly different.
Note that the exact steps may vary slightly between different browsers, but the overall process should be similar.
We welcome contributions to this project! If you have an idea for a new feature or a bug fix, please open a pull request.
This project is licensed under the MIT License.
FAQs
Node.js Open Source project for making API calls to ChatGPT using TypeScript
We found that chatgpt-plus-unofficial-client 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.