Skip to main content

WRaThioN: WRTN Client For Python

Project description

WRaThioN: WRTN Client For Python

[!WARNING] This is an unofficial client. This package does not take into account WRTN's terms and conditions. Any dispute with WRTN regarding the terms and conditions is entirely your responsibility.

Installation

$ pip install WRaThioN

Usage

Requirements

Get Cookies

To use WRaThioN, you need a refresh token and an id called '__w_id' in the cookie.

You can retrieve cookies from WRTN as follows:

  1. Go to WRTN.
  2. Log in with your WRTN account.
  3. Open developer tools in your browser (usually by pressing 'F12').
  4. You can view all cookies associated with 'https://wrtn.ai' by selecting the 'Application' tab and clicking on the 'Cookies' option.
  5. Find the '__w_id' and 'refresh_token' cookies and click on them to expand their details.
  6. Copy the value of each cookie.

Use Prompt

$ python3 -m WRaThioN --help
usage: WRaThioN.py [-h] [--token TOKEN] [--id ID]

WRTN AI Prompt

options:
  -h, --help     show this help message and exit
  --token TOKEN  refresh token
  --id ID        wrtn id(__w_id)

Example

from WRaThioN import WRaThioN
import argparse

def main() -> None:
    client = WRaThioN(args.token, args.id)

    client.create_chat()
    while True:
        prompt = input("You: ")

        if prompt == "!reset":
            client.create_chat()
            continue
        elif prompt == "!exit":
            client.delete_chat()
            break

        print("Bot: ", end="", flush=True)
        response = client.chat(prompt)
        print(response['message']['content'], end="", flush=True)
        print("\n")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='WRTN AI Prompt')
    parser.add_argument('--token', type=str, help='refresh token')
    parser.add_argument('--id', type=str, help='wrtn id(__w_id))')

    args = parser.parse_args()
    
    main()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

WRaThioN-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file WRaThioN-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: WRaThioN-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for WRaThioN-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e330339ea4dbef36a59ea4a129840853dbe4f0fba1a9149161d39e85839639e9
MD5 64b05aaf7779426e2d0b9698e20dbdb2
BLAKE2b-256 d871c67c2e9071e7aefff1848f1c73a2716c52c20ce1f0508b925f41364fb2fa

See more details on using hashes here.

Supported by

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