Crates.io | answer |
lib.rs | answer |
version | 0.0.1-beta.1 |
source | src |
created_at | 2023-03-14 02:15:26.207579 |
updated_at | 2023-03-15 19:16:39.799486 |
description | answer any question right from your terminal, using the same large language model that powers ChatGPT |
homepage | https://github.com/schneiderfelipe/answer |
repository | |
max_upload_size | |
id | 809404 |
size | 60,042 |
answer
any question right from your terminal,
using the same
large language model
that powers
ChatGPT.
$ echo "🌠= 🥪?" | answer
No, a hot dog (ðŸŒ) is not the same as a sandwich (🥪).
While they both consist of bread and a filling,
a sandwich typically has separate slices of bread,
while a hot dog has a single bun that is sliced
on the top and filled with a sausage.
Read the installation and usage instructions below.
Either clone the repository to your machine and install from it, or install directly from GitHub. Both options require Rust and Cargo to be installed.
# Option 1: cloning and installing from the repository
$ git clone https://github.com/schneiderfelipe/answer.git
$ cd answer && cargo install --path=answer/
# Option 2: installing directly from GitHub
$ cargo install --git=https://github.com/schneiderfelipe/answer
Before using answer
,
you need to set up your environment to use
OpenAI's chat completion API
(the same technology that powers OpenAI's most advanced language model,
ChatGPT).
To set up your environment,
you'll need to have a secret API key from OpenAI,
which can be obtained at
OpenAI's online platform.
Next, set an environment variable in your shell as follows:
export OPENAI_API_KEY="sk-...a1b2"
With your environment set up, you're ready to start using the command-line application. Here's an example:
$ echo "Date of birth of Malcolm X?" | answer
The date of birth of Malcolm X is May 19, 1925.
You can also get answer
s in context by providing a YAML file containing
the initial part of a chat history.
For example:
# birthdates.yml
messages:
- role: system
content: >-
You are a date of birth checker.
Given the name of a person,
your job is to specify the date of birth of said person.
$ echo "Malcolm X" | answer birthdates.yml
Malcolm X was born on May 19th, 1925.
The file format closely resembles both OpenAI's higher-level API and its lower-level ChatML format.
This project forbids unsafe code usage.
License: MIT