Skip to main content

some useful api from poe.com

Project description

web_poe_api

some useful api from poe.com

import os
from web_poe_api import use_bot,refresh_bot,create_bot
import json
import re

################################################
Path = os.path.dirname(os.path.abspath(__file__))
cookie = 'p-b=cktSb3s2AtYuPthsaZURfQ%3D%3D'
poe_formkey = '130f5fe51cb31eeeb056890004a17a89'
poe_tchannel =  'poe-chan53-8888-ejnafarqnmuzwuvbncmf'
#封包原函数,方便使用
def create_mybot(nickname,prompt,model):
    return create_bot(nickname=nickname,prompt=prompt,model=model,dict_path=rf'{Path}\bot_dict.json',cookie=cookie,poe_formkey=poe_formkey,poe_tchannel=poe_tchannel)

def use_mybot(query,bot):
    with open(rf'{Path}\bot_dict.json', 'r') as f:
        bot_dict = json.load(f)
        return use_bot(query,bot,bot_dict=bot_dict,cookie=cookie,poe_formkey=poe_formkey,poe_tchannel=poe_tchannel)
    
def refresh_mybot(nickname):
    with open(rf'{Path}\bot_dict.json', 'r') as f:
        bot_dict = json.load(f)
    refresh_bot(nickname,bot_dict,cookie,poe_formkey=poe_formkey,poe_tchannel=poe_tchannel)
################################################
# 创建bot,参数依次为nickname,预设prompt,模型(gpt3_5或者claude)
# create_mybot("xhssss","省略一下~~~",'gpt3_5')
# 参数为nickname
# refresh_mybot('xhssss')
# 参数为问题query,nickname询问对象
last_answer,chat_suggest,chat_list_text,chat_list_raw = use_mybot(query="你是谁",bot='xhssss')
print(last_answer)
print(*chat_suggest)




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_poe_api-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

web_poe_api-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file web_poe_api-1.0.0.tar.gz.

File metadata

  • Download URL: web_poe_api-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for web_poe_api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0eb20b5c2e9fed8220605f90b5a531409df744b675479161a2aa2464b10115f2
MD5 fcd555635ce7b5000dc0a576008f5a6e
BLAKE2b-256 97c77219290436b04373f9e40225b7867713f307af0bf23b631d1690c2345fc6

See more details on using hashes here.

File details

Details for the file web_poe_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: web_poe_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for web_poe_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f398f9cae38d8bd3c4475c1e494384192c0767a2bd40679a3e772cb7c9b6d9d2
MD5 a0bab94e73e255a587f898d1a89fb668
BLAKE2b-256 e03019f2c413ae1841aa8810bc1d6454f1b0eed08165d295c5c477de30293ac8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page