이 라이브러리는 OpenAI에 unix-ey 인터페이스를 제공합니다. 아래의 설치 및 설정을 참조하십시오. 그러나 먼저 몇 가지 예.
$ ai what is two plus two
Two plus two is equal to four.
$ uptime | ai convert this to json
{
"time_of_measurement": "13:48:26",
"up_time": "30 days, 18:07",
"users": 3,
"load_average": [
0.46,
0.61,
0.79
]
}
$ ai list the nine planets as JSON | ai convert this to XML but in French | tee planets.fr.xml
<Planètes>
<Planète>Mercure</Planète>
<Planète>Vénus</Planète>
<Planète>La Terre</Planète>
<Planète>Mars</Planète>
<Planète>Jupiter</Planète>
<Planète>Saturne</Planète>
<Planète>Uranus</Planète>
<Planète>Neptune</Planète>
<Planète>Pluton</Planète>
</Planètes>
$ curl -sL " https://en.wikipedia.org/wiki/cats " | head -n 5 | ai extract just the title of this webpage | figlet
____ _ __ ___ _ _ _ _
/ ___|__ _| |_ / (_) | _(_)_ __ ___ __| (_) __ _
| | / _` | __| _____ / / /| | |/ / | '_ / _ / _` | |/ _` |
| |__| (_| | |_ |_____| V V / | | <| | |_) | __/ (_| | | (_| |
______,_|__| _/_/ |_|_|__| .__/ ___|__,_|_|__,_|
|_|
$ ls | ai What is this directory for ?
This directory contains the source code for a Ruby-based project called openai_pipe. It includes files related to the project's license (LICENSE.txt), changelog (CHANGELOG.md), dependencies (Gemfile and Gemfile.lock), executables (bin and exe), libraries (lib), signature (sig) and tests (spec). There is also a Rakefile and a README.md file which provide information about how to build and install the project, as well as its features and usage. Finally, it includes the openai_pipe-0.1.0.gem and openai_pipe.gemspec files which are used to build the gem which can be installed on other systems.
$ ls -l | ai which of these are directories ?
bin, exe, lib, sig, spec
$ ls | ai " For each of these files, provide a description of what is likely to be their contents? "
bin - Likely contains compiled binary executable files.
CHANGELOG.md - Likely contains a log of changes/modifications, such as bug fixes and new features, that have been made to the project.
exe - Likely contains executable files.
french_planets.xml - Likely contains an XML file containing data related to planets, likely in French.
Gemfile - Likely contains Ruby code for the project's dependencies.
Gemfile.lock - Likely contains a snapshot of the dependencies of the project and versions of those dependencies.
lib - Likely contains the Ruby source code (e.g. classes and modules) for the project.
LICENSE.txt - Likely contains the terms of use/license for the project.
openai_pipe-0.1.0.gem - Likely contains a gem that gathers information from the OpenAI API.
openai_pipe.gemspec - Likely contains configuration details for the gem.
planets.lst - Likely contains a list of planets.
poem.txt - Likely contains a text file containing a poem.
Rakefile - Likely contains Ruby tasks and dependencies that can be used in projects.
README.md - Likely contains general information about the project and usage instructions.
reverse.lst - Likely contains a list of words or items that are in reverse order.
sig - Likely contains digital signatures to validate individual files.
spec - Likely contains Ruby specs (i.e. tests) for the project.
uptime.json - Likely contains a file with information regarding system uptime of a computer.
$ git commit -m " $( git status | ai write me a commit message for these changes ) "
[master 7d0271f] Add new files and modify README.md
$ git status | tee /dev/tty | ai write me a sonnet about the status of this git repository
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
openai_pipe-0.1.0.gem
nothing added to commit but untracked files present (use "git add" to track)
My master branch may lack to thee its kin
For change it holds the only force within
Thé untracked files, they still remain unnamed
‘Tis fervent hope thé change will soon be claimed
Fraught with the choice to leave or to persist
The repository wavers ‘tween future and past
The openai_pipe-0.1.0 gem stands out
Waiting to be added, not yet about
The commit awaits for brave new changes bold
While time’s old force is ever unfurled
Commit forth young mind, furrow not to crawl
From untracked files, a future stands tall.
% history | ai what was the last thing I did
The last command you entered was 'history'.
NB는 어떻게 든 역사상 생산량을보고 역사적 명령 회비 자체가 출력에 기록 명령을 포함하지 않았다고 판단합니다.
$ history | ai what was the last thing I did before typing history
The last thing you did was amend a README.md file.
여기서는 수정 사항이 이전 명령이 아니라 readm.md를 편집 한 이전 명령에서 읽기를위한 수정 사항을 결정합니다.
$ cat lib/openai_pipe/version.rb | ai rewrite this file with just the minor version incremented | sponge > lib/openai_pipe/version.rb
$ git diff
diff --git a/lib/openai_pipe/version.rb b/lib/openai_pipe/version.rb
index 0f82357..cc57fab 100644
--- a/lib/openai_pipe/version.rb
+++ b/lib/openai_pipe/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module OpenAIPipe
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end
$ ruby -e " $( ai write me a python script that prints the current month | ai translate this into ruby ) " | ai translate this into French
Le mois courant est Décembre.
실행하여 보석을 설치하십시오.
$ gem install openai_pipe
이 라이브러리는 Ruby-Optai 자체를 사용하는 Quick_openai를 사용하므로 먼저 해당 프로젝트에 익숙해지기를 원할 수 있습니다.
이 라이브러리는 OpenAI GPT3을 사용하여 리조트를 생성하므로 약에 대한 액세스 토큰을 사용할 수 있어야합니다. .bashrc 또는 이와 동등한
export OPENAI_ACCESS_TOKEN=mytoken
기본적으로 실행 파일을 openai_pipe
라고합니다. 이 명령을 별칭으로 제외하여 .bashrc 또는 그에 상응하는 Shunter에 대한 것입니다.
alias ai= " openai_pipe "
GPT3이 호출 될 때마다 관련 비용이 관련되어 있으므로 계정을 염두에 두십시오. 또한 민감한 데이터를 OpenAI로 전송하는 데주의를 기울이고 GPT3가 생성하는 스크립트 또는 프로그램을 임의로 실행하는 데 조심해야합니다.
레포를 확인한 후 bin/setup
실행하여 종속성을 설치하십시오. 그런 다음 rake spec
실행하여 테스트를 실행하십시오. 또한 경험을 쌓을 수있는 대화식 프롬프트를 위해 bin/console
실행할 수도 있습니다.
이 보석을 로컬 머신에 설치하려면 bundle exec rake install
실행하십시오. 새 버전을 해제하려면 version.rb
에서 숫자를 업데이트 한 다음 bundle exec rake release
에 대한 git 태그를 생성하고 git 커밋 및 생성 된 태그를 푸시하고 .gem
파일을 rubygems.org로 누릅니다.
https://github.com/aesthetikx/openai_pipe에서 버그 보고서 및 풀 요청은 환영합니다.
보석은 MIT 라이센스의 활주로 아래 오픈 소스로 제공됩니다.