npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

poe-chat-api

v2.1.0

Published

A Node.js library for connecting to GPT-3.5 via Poe.com

Downloads

100

Readme

Poe-chat-api

A Node.js library for connecting to GPT-3.5 via Poe.com

Features

  • Create bot
  • Get bots
  • Delete bot
  • Send message
  • Get messages
  • Delete all messages
  • Break chat
  • ...

Installation

    npm i poe-chat-api

In the next step you need to find your poe cookie from the poe website. To do this, follow the steps below

Go to poe.com > Log in or register > Open inspect > Select the Application tab > Select the Cookies tab > Copy the cookie value named p-b

Fill YOUR-POE-COOKIE with the copied value

const Client = require("poe-chat-api")(async () => {
  const instance = new Client("YOUR-POE-COOKIE", {
    showSteps: true,
  });
})();

For parallel sending, it must be noPattern: false, and the format of sending and receiving messages must be changed. To do this, do the following steps.

1- First, enter your bot profile in poe and add the following text in the prompt section


Remember that you will be given a code at the beginning of each message and you must enter it at the beginning of each reply in the format [p@tter#F-Code].
for example:
[p@tter#F-Code]
your answer.

The code with the p@tter#F pattern is sent in [p@tter#F-Code] format and received in the same format.

Above, a template containing the message is sent so that we can understand which response corresponds to which message.

The pattern is inside a bracket.

The first part of the format is p@tter#F. You can edit it in the instance.init method.

The middle part is a type of space (-) and the last part is the messageId that is generated by the library and is unique. You can also set a messageId in the client.sendMessage method, but it must be unique.

If you are developing an project, I recommend you to use this method instead of the normal method of sending messages.

2- Set noPattern: false

Note: This feature is currently only supported using bots

API Reference

client.sendMessage

client.sendMessage(Parameters, (response,text) => {})
  Parameters

| Parameter | Type | Default| Description | | :-------- | :-------: | :-------: | :----------- | | message | string | null | Required. The text of your message | | withChatBreak | boolean | false | Optional. Will the chat be broken? | | messageId | number | random | Optional. It only works if noPattern: false. | | paginationMethod | boolean | false | Optional. This method makes the GraphQl request to receive the result of the message instead of using the websocket. which is not more efficient than the websocket method. It is recommended to use it only when you use groups and you put many bots in the group. | | paginationCount | number | 10 | Optional. Specifies the number of messages received from pagination requests. The more it is, the higher the probability of ratelimit, and the greater the inefficiency. But if it is balanced, it will help to better check the message response. It is best to set it to a level that can cover the last few messages. | | paginationRefreshDelay | number | 3000 | Optional. If the response is not received, it tries to resend the request to receive the response. This property is related to the delay in sending each time. Example 3000ms means every 3000 milliseconds re-request is sent until a response is received. |

Callback

| Parameter | Type |Description | | :-------- | :-------: | :------- | | response | object | The complete response result contains an object. | | text | string | Summarized answer in text format |