Skip to main content

What is it? pyWhat but with LLMs

Project description

LangWhat

Answer "What is it?" on the command line with the power of large language models (LLMs).

pyWhat LLM version, leveraging OpenAI API and Sydney (Bing AI Chat).

Screenshots

OpenAI

langwhat 'f7316ffccd4d2d555a7522328cf792dd73bfbcd9'

langwhat 'f7316ffccd4d2d555a7522328cf792dd73bfbcd9' --zh

Sydney

Sydney fixed my type "marry" automatically.

langwhat 'marry ball washington' -s

langwhat 'marry ball washington' -s -z

Caching

Responses are much faster when cache hits, and token usage becomes 0.

Note that Sydney doesn't support counting token usage, and always shows 0.

lw teddy --show-token-usage

lw teddy --show-token-usage

Features

  • Uses few-shot prompting to reduce model mis-behavior
  • English by default for superior response speed and accuracy
  • Supports supplying API Key via either environment variable or config file at ~/.config/langwhat/api_key.txt
  • Supports using Sydney with -s flag
  • Caching responses in a local sqlite database

Installation

pipx

This is the recommended installation method.

$ pipx install langwhat

# python 3.11 or higher is required, if your pipx uses a lower version of python by default,
# you could run the following command to install langwhat with python 3.11
# pipx install --python "$(which python3.11)"

pip

$ pip install langwhat

Usage

$ langwhat --help

usage: lw [-h] [-z] [-s] [-C] [--show-token-usage] [-V] what

positional arguments:
  what                what is it

options:
  -h, --help          show this help message and exit
  -z, --zh            Use Mandarin to prompt and answer
  -s, --sydney        Use Sydney (Bing AI) instead of OpenAI
  -C, --no-cache      Disable cache
  --show-token-usage  Show token usage
  -V, --version       show program's version number and exit

Develop

$ git clone https://github.com/tddschn/langwhat.git
$ cd langwhat
$ poetry install

Credits

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

langwhat-2.0.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

langwhat-2.0.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file langwhat-2.0.3.tar.gz.

File metadata

  • Download URL: langwhat-2.0.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/22.3.0

File hashes

Hashes for langwhat-2.0.3.tar.gz
Algorithm Hash digest
SHA256 432537d4ef49a39e4372cd11470ea6a32e933bb039c5a13e8b47403644c0823d
MD5 64f04e108c2ae9083a0f8709bda952e6
BLAKE2b-256 a4fed39a11a59053a086789c9948e22ff17f3ee34aeb3053b4a3be20316202d9

See more details on using hashes here.

File details

Details for the file langwhat-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: langwhat-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/22.3.0

File hashes

Hashes for langwhat-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61f909e9e755236587b8c20bf7cf526b849b150a52d3d038d085e7a33e4f3bc3
MD5 4be2a814b280cf08c97173bb73644fd9
BLAKE2b-256 7725e9588751ea647caeff979dfc8741864478c01cd9f24fff82ae457e4f5ed2

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