ห้องสมุดนี้ให้อินเทอร์เฟซ Unix-ey กับ OpenAI ดูการติดตั้งและการตั้งค่าด้านล่าง แต่ก่อนอื่นตัวอย่างบางส่วน
$ 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 อย่างใดมันเห็นเอาท์พุทประวัติศาสตร์-esque และกำหนดว่าประวัติศาสตร์ถูกพิมพ์-ค่าธรรมเนียมคำสั่งประวัติศาสตร์ไม่รวมตัวเองรวมคำสั่งประวัติในผลลัพธ์
$ history | ai what was the last thing I did before typing history
The last thing you did was amend a README.md file.
NB ที่นี่มันจะกำหนดการแก้ไขคือการอ่านไม่ได้มาจากคำสั่งก่อนหน้า แต่มาจากคำสั่งก่อนหน้านี้ที่แก้ไขแล้ว 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
ห้องสมุดนี้ใช้ Quick_openai ซึ่งใช้ Ruby-Optai ดังนั้นคุณอาจต้องการทำความคุ้นเคยกับโครงการเหล่านั้นก่อน
ไลบรารีนี้ใช้ OpenAI GPT3 เพื่อสร้างรีสอร์ทดังนั้นคุณจะต้องมีโทเค็นการเข้าถึงของคุณโดยประมาณ ใน. bashrc หรือเทียบเท่า
export OPENAI_ACCESS_TOKEN=mytoken
โดยค่าเริ่มต้นปฏิบัติการเรียกว่า openai_pipe
มีการสรรหานามแฝงคำสั่งนี้กับบางสิ่งบางอย่าง shunter ใน. bashrc หรือเทียบเท่าเช่น
alias ai= " openai_pipe "
โปรดทราบว่ามีค่าใช้จ่ายที่เกี่ยวข้องทุกครั้งที่ GPT3 ถูกเรียกใช้ดังนั้นโปรดระวังบัญชีของคุณ นอกจากนี้ยังต้องระวังการส่งข้อมูลที่ละเอียดอ่อนไปยัง OpenAI และระวังการดำเนินการสคริปต์หรือโปรแกรมที่ GPT3 สร้างขึ้นโดยพลการ
หลังจากตรวจสอบ repo ให้เรียกใช้ bin/setup
เพื่อติดตั้งการพึ่งพา จากนั้นเรียกใช้ rake spec
เพื่อเรียกใช้การทดสอบ คุณยังสามารถเรียกใช้ bin/console
สำหรับพรอมต์แบบโต้ตอบที่จะช่วยให้คุณได้สัมผัส
ในการติดตั้งอัญมณีนี้ลงในเครื่องท้องถิ่นให้เรียกใช้ bundle exec rake install
หากต้องการเปิดตัวเวอร์ชันใหม่ให้อัปเดตหมายเลขใน version.rb
จากนั้นเรียกใช้ bundle exec rake release
ซึ่งจะสร้างแท็ก Git สำหรับเวอร์ชัน Push Git Commites และแท็กที่สร้างขึ้นและกดไฟล์ .gem
ไปยัง rubygems.org
รายงานข้อผิดพลาดและคำขอดึงยินดีต้อนรับบน GitHub ที่ https://github.com/aesthetikx/openai_pipe
อัญมณีมีให้บริการในฐานะโอเพ่นซอร์สภายใต้ Tarms ของใบอนุญาต MIT