Skip to main content

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

Metadata

Release files for langwhat 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langwhat 2.0.3
File Size Uploaded
langwhat-2.0.3.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langwhat 2.0.3
File Interpreter ABI Platform
langwhat-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / langwhat-2.0.3.tar.gz

Download URL langwhat-2.0.3.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
432537d4ef49a39e4372cd11470ea6a32e933bb039c5a13e8b47403644c0823d
BLAKE2b-256 checksum
How to use checksums
a4fed39a11a59053a086789c9948e22ff17f3ee34aeb3053b4a3be20316202d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.2 Darwin/22.3.0

Release files / langwhat-2.0.3-py3-none-any.whl

Download URL langwhat-2.0.3-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61f909e9e755236587b8c20bf7cf526b849b150a52d3d038d085e7a33e4f3bc3
BLAKE2b-256 checksum
How to use checksums
7725e9588751ea647caeff979dfc8741864478c01cd9f24fff82ae457e4f5ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.2 Darwin/22.3.0

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page