Git Product home page Git Product logo

langwhat's Introduction

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 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

langwhat's People

Contributors

tddschn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.