나노 앱은 나노 봇에 포함시킬 수있는 작은 응용 프로그램입니다. 인간이 렌치, 계산기, 스크린 리더 또는 인터넷 액세스와 같은 도구에 액세스하여 기능을 증폭시킬 수있는 것처럼 나노 봇은 나노 앱을 장착 할 때 기능을 향상시킬 수 있습니다.
나노 앱은 LUA, 회향 또는 clojure로 작성할 수 있습니다. 이 특정 저장소는 Nano 앱에 Clojure를 사용하도록 선택했습니다.
나노 봇 CLI 및 Babashka를 설치하고 설정하십시오.
git clone https://github.com/gbaptista/nano-apps.git
cd nano-apps
bb tasks/generate-cartridge.clj cartridges/template.yml cartridge.yml
# Cartridge successfully generated at cartridge.yml
nb cartridge.yml - repl ?> What day of the week is it today?
date-and-time {}
{:date-time 2023-12-02T14:19:18-03:00, :timezone America/Sao_Paulo}
Today is Saturday.
?> |
exit 입력하여 대체를 종료 할 수 있습니다.
기본 작업 및 파생 상품 및 적분과 같은 복잡한 계산을 포함한 산술 및 상징적 수학에 대한 GNU 옥타브를 제공합니다.
GNU 옥타브 설치 :
sudo pacman -S octave # Arch / Manjaro
sudo apt-get install octave # Debian / Ubuntu / Raspberry Pi OS
sudo dnf install octave # Fedora / CentOS / RHEL 설치 후, symbolic 패키지를 설치해야합니다 : pkg install -forge symbolic
octave GNU Octave, version 6.4.0
octave:1> pkg install -forge symbolic
For information about changes from previous versions of the symbolic package, run 'news symbolic'.
octave:2>
파생 예 :
?> What is the derivative of the function f(x) = 3x^2 + 5x + 2 with respect to x?
advanced-calculator {"expression":"syms x; diff(3*x^2 + 5*x + 2)"}
Symbolic pkg v3.1.1: Python communication link active, SymPy v1.11.1.
ans = (sym) 6⋅x + 5
The derivative of the function f(x) = 3x^2 + 5x + 2 with respect to x is 6x + 5.
?> Find the derivative of the function g(x) = e^(2x) – cos(x) with respect to x.
advanced-calculator {"expression":"syms x; diff(exp(2*x) - cos(x))"}
Symbolic pkg v3.1.1: Python communication link active, SymPy v1.11.1.
ans = (sym)
2⋅x
2⋅ℯ + sin(x)
The derivative of the function g(x) = e^(2x) – cos(x) with respect to x is 2e^(2x) + sin(x).
?> |
적분 예 :
?> What is the indefinite integral of the function f(x) = 1/(x^2 + 1) with respect to x?
advanced-calculator {"expression":"syms x; int(1/(x^2 + 1))"}
Symbolic pkg v3.1.1: Python communication link active, SymPy v1.11.1.
ans = (sym) atan(x)
The indefinite integral of the function f(x) = 1/(x^2 + 1) with respect to x is atan(x) + C,
where C is the constant of integration.
?> Calculate the definite integral of g(x) from x = 0 to x = pi of g(x) = sin^2(x).
advanced-calculator {"expression":"syms x; int(sin(x)^2, 0, pi)"}
Symbolic pkg v3.1.1: Python communication link active, SymPy v1.11.1.
ans = (sym)
π
─
2
The definite integral of g(x) = sin^2(x) from x = 0 to x = pi is pi/2.
?> |
시계에 대한 기본 액세스를 제공하여 나노 봇이 날짜와 시간에 액세스 할 수 있습니다.
예 :
?> What time is it?
date-and-time {}
{:date-time 2023-12-02T12:22:01-03:00, :timezone America/Sao_Paulo}
The current time is 12:22:01 PM in the timezone America/Sao Paulo.
?> What day of the week is it today?
Today is Saturday.
?> |
MPRIS D-BUS 인터페이스 사양을 구현하는 미디어 플레이어를 제어하기위한 PlayERCTL을 제공합니다.
playerCtl 설치 :
sudo pacman -S playerctl # Arch / Manjaro
sudo apt-get install playerctl # Debian / Ubuntu / Raspberry Pi OS
sudo dnf install playerctl # Fedora / CentOS / RHEL예 :
?> which players do i have?
media-player-control {"command":"list"}
chromium.instance12231
plasma-browser-integration
You have two media players available for control:
1. Chromium, with an instance ID of 12231.
2. Plasma Browser Integration.
These players can be controlled with play, pause,
stop, and various other media control commands.
?> what's playing on plasma?
media-player-control {"command":"metadata","player":"plasma-browser-integration"}
plasma-browser-integration kde:mediaSrc blob:https://www.youtube.com/9c1414f1-5ae7-43d3-a7e2-45f519cdb0a9
plasma-browser-integration kde:pid 12231
plasma-browser-integration mpris:artUrl https://i.ytimg.com/vi/1JNmz17gnMw/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDr0ppBmCZeRzvIfsuDAY7BxKYeBQ
plasma-browser-integration mpris:length 350041000
plasma-browser-integration mpris:trackid '/org/kde/plasma/browser_integration/1337'
plasma-browser-integration xesam:artist Polyphia
plasma-browser-integration xesam:title Polyphia - Ego Death feat. Steve Vai (Official Music Video)
plasma-browser-integration xesam:url https://www.youtube.com/watch?v=1JNmz17gnMw
Currently, on Plasma Browser Integration, the track
"Ego Death" by Polyphia featuring Steve Vai is playing.
This is the official music video on YouTube.
The artwork for the track is available as well, which
you would recognize from the video thumbnail on YouTube.
?> pause the song
media-player-control {"command":"pause","player":"plasma-browser-integration"}
The song has been paused on Plasma Browser Integration.
If you wish to resume playback, just let me know!
?> resume playing
media-player-control {"command":"play","player":"plasma-browser-integration"}
The song is now playing again on Plasma Browser Integration.
Enjoy the music!
?> go back to the beginning of the song
media-player-control {"command":"position","player":"plasma-browser-integration","option":"0"}
I've reset the song to the beginning for you.
?> turn up the volume to the maximum
media-player-control {"command":"volume","player":"plasma-browser-integration","option":"1.0"}
?> |
임의 숫자를 생성하는 기능을 제공합니다.
예 :
?> Choose a random number.
random-number {"from":1,"to":100}
53
The random number chosen is 53.
?> I would like a random number between 350 and 480.
random-number {"from":350,"to":480}
382
The random number chosen between 350 and 480 is 382.
?> |
☠️ 경고 : 이 나노 앱은 시스템에서 위험하고 파괴적인 운영을 실행할 수 있습니다. 조심하십시오.
Linux 터미널에 사용 된 것과 유사한 Shell 명령을 실행하여 컴퓨터 시스템 및 데이터와 상호 작용할 수있는 수단을 제공합니다. 소프트웨어에 명령을 보내고 정보를 추출하며 다양한 작업을 수행 할 수 있습니다.
예 :
?> How much space do I have on my disk?
sh {"command":["df","-h","--output=avail","/"]}
Avail
478G
You have 478 GB of available space on your disk.
?> How many cores does my CPU have?
sh {"command":["nproc"]}
8
Your CPU has 8 cores.
?> Am I connected to the Internet?
sh {"command":["ping","-c","1","8.8.8.8"]}
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=16.1 ms
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 16.126/16.126/16.126/0.000 ms
Yes, you are connected to the Internet. I successfully pinged the
IP address 8.8.8.8 (Google's DNS server) and received a response.
?> |
산술 계산을 수행하기 위해 GNU BC를 제공하십시오. 임의의 정밀도를 가진 지수 및 다양한 기능뿐만 아니라 추가, 뺄셈, 곱셈, 분할 및 계수 작업을 처리 할 수 있습니다.
GNU BC 설치 :
sudo pacman -S bc # Arch / Manjaro
sudo apt-get install bc # Debian / Ubuntu / Raspberry Pi OS
sudo dnf install bc # Fedora / CentOS / RHEL예 :
?> How much is 10 plus 15?
simple-calculator {"expression":"10+15"}
25
10 plus 15 equals 25.
?> What is the remainder when dividing 28 by 6?
simple-calculator {"expression":"28 % 6"}
4
The remainder when dividing 28 by 6 is 4.
?> Calculate if 3 is less than 4.
simple-calculator {"expression":"3<4"}
1
The calculation confirms that 3 is less than 4.
?> What is 3 divided by 2?
simple-calculator {"expression":"scale=1; 3/2"}
1.5
3 divided by 2 equals 1.5.
?> |
WTTR.IN의 온도, 풍속 및 습도를 포함한 일기 예보 및 현재 조건을 제공합니다. 또한 일출의 시간과 일몰 시간과 같은 천문 데이터, 달에 대한 세부 사항도 제공합니다.
예 :
?> What's the current temperature in New York?
weather {"location":"New York"}
{:current_condition [{:FeelsLikeC 4, :windspeedMiles...
The current temperature in New York is 6°C (43°F).
?> Tell me about the moon in Cairo today.
weather {"location":"Cairo"}
{:current_condition [{:FeelsLikeC 25, :windspeedMiles...
In Cairo today, the moon is in a Waning Gibbous phase with 79% illumination.
Moonrise is at 9:30 PM and moonset is at 10:57 AM (local time).
?> Should I wear sunglasses or carry an umbrella in Rome today?
weather {"location":"Rome"}
{:current_condition [{:FeelsLikeC 12, :windspeedMiles...
You should wear sunglasses in Rome today, as the weather is partly cloudy with
a 0.0 mm precipitation forecast, indicating no need for an umbrella.
?> What's the likelihood of me seeing a rainbow this afternoon in Rio de Janeiro?
weather {"location":"Rio de Janeiro"}
{:current_condition [{:FeelsLikeC 29, :windspeedMiles...
The likelihood of seeing a rainbow this afternoon in Rio de Janeiro is
low as the weather is partly cloudy with no precipitation reported.
Rainbows typically require rain combined with sunshine.
?> Is it a good day for kite flying in Sydney based on wind conditions?
weather {"location":"Sydney"}
{:current_condition [{:FeelsLikeC 18, :windspeedMiles...
Yes, it's a good day for kite flying in Sydney.
The weather is clear with wind speeds of 9 km/h (6 miles per hour).
?> |
당신이하려는 것과 비슷한 내부 /apps 내부의 폴더를 복사하여 붙여 넣으십시오. 구조는 구조의 구조입니다 : 구조는 다음과 같습니다. 구조는 다음과 같습니다.
app.clj : 나노 앱 소스 코드.specification.yml : 나노 봇의 나노 앱 사양.test.clj : 나노 앱 테스트.또한 :
README.md : 다른 곳에서 사용되지 않고이 readme를 향상시키기 위해 인간을위한 readme.기본 템플릿에서 모든 나노 앱이 포함 된 카트리지를 생성하십시오.
bb tasks/generate-cartridge.clj [CARTRIDGE-TEMPLATE] [OUTPUT-FILE]
# If you don't want to include your private Nano Apps:
bb tasks/generate-cartridge.clj [CARTRIDGE-TEMPLATE] [OUTPUT-FILE] --no-private
bb tasks/generate-cartridge.clj cartridges/template.yml cartridge.yml
# => cartridge.yml
bb tasks/generate-cartridge.clj cartridges/template.yml cartridge.yml --no-private
# => cartridge.yml카트리지를 생성 한 후 나노 봇 CLI가 있다는 점을 고려하면 즉시 시도 할 수 있습니다.
nb cartridge.yml - repl
?> what time is it?
date-and-time {}
{:date-time 2023-12-02T14:10:05Z, :timezone UTC}
The current time in UTC is 14:10:05 on December 2, 2023.
?> |
exit 입력하여 대체를 종료 할 수 있습니다.
모든 테스트 실행 :
bb tasks/run-tests.clj개별 테스트 실행 :
bb apps/simple-calculator/test.clj개인 나노 앱을 제외한 모든 테스트 실행 :
bb tasks/run-tests.clj --no-private template.md 파일을 업데이트 한 다음 :
bb tasks/generate-readme.clj template.md 변경 될 때 README.md 자동으로 업데이트하기위한 트릭 :
sudo pacman -S inotify-tools # Arch / Manjaro
sudo apt-get install inotify-tools # Debian / Ubuntu / Raspberry Pi OS
sudo dnf install inotify-tools # Fedora / CentOS / RHEL
while inotifywait -e modify -e create template.md apps/ * /README.md ; do bb tasks/generate-readme.clj ; doneMarkdown 라이브 미리보기의 트릭 :
pip install -U markdown_live_preview
mlp README.md -p 8076bb tasks/cljfmt-fix.clj Pattern user@app 사용하여 리포지토리에 전달되지 않는 개인 나노 앱을 만들 수 있습니다.
apps/your-name@your-app/app.clj
개인 카트리지 템플릿에도 동일하게 적용됩니다.
cartridges/[email protected]
Cartridge Generation에서 개인 나노 앱을 다음과 같이 제외 할 수 있습니다.
bb tasks/generate-cartridge.clj cartridges/template.yml cartridge.yml --no-private개인 나노 앱을 제외한 모든 테스트 실행 :
bb tasks/run-tests.clj --no-private 나노 앱은 나노 봇의 일부로 설계되었으므로 나노 봇의 사양 및 원리에 익숙해지는 것이 중요합니다.
나노 앱은 AI 제공 업체의 기능만큼 우수합니다. 따라서 핵심 원칙으로, 신속한 엔지니어링 에 대해 배운 모든 것은 특히 사양을 작성할 때 나노 앱 개발에 고려하고 적용해야합니다.
때때로 "이것은 너무 복잡하다"또는 "유용하지 않을 것"또는 "왜 이것을 사용 하는가?"등의 느낌이들 수도 있습니다.
구체적인 예를 들어 미디어 플레이어 컨트롤에는 제공 할 가치가 없다고 생각하는 명령이 있습니다. 그러나 주변에서 놀고 있다면 모델이 어떻게 사용하는지에 대한 많은 "와우"순간이있을 것입니다.
따라서 창의적이고 탐험 할 수있는 공간을 제공하고 확실하지 않다고 생각하기 때문에 기능을 유지하지 마십시오.
LLM은 상당한 양의 데이터를 처리 할 수 없게되지만 토큰과 관련하여 다음을 고려해야합니다.
불필요하게 긴 출력을 제공하지 마십시오. 출력을 간결하게 만들 수있는 기회를 포착하십시오. 예기치 않게 긴 출력을 생성 할 수 있으므로 쿼리 데이터베이스 또는 명령을 실행하는 나노 앱을 구축 할 때주의하십시오.
인기있는 소프트웨어의 프록시로 Nano 앱을 사용할 때는 출력이 실제 소프트웨어에 충실해야합니다. 모델이 출력이 프로그램에서 정확히 기대할 때 더 나은 이유는 이유가 있습니다.
예를 들어, Nano 앱이 GNU 옥타브 소프트웨어의 프록시 인 경우 작업에 대한 예상 출력은 다음과 같습니다.
ans = 6
ans = 6 대신 6 만 반환하도록 단축하려는 유혹이있을 수 있습니다. 그렇게하지 마십시오. 모델이 훈련 중에 기대하는 것을 배운 것과 같이 원래 출력을 유지하십시오.
오류를 간결하게 유지하고 (간결한 출력) 도움이되고 도움이됩니다 (프롬프트 엔지니어링).
인기있는 소프트웨어의 프록시로 Nano 앱을 사용할 때는 소프트웨어에서 원래 오류 출력 공유 (출력 충실도)를 우선 순위를 정하십시오. 일부 소프트웨어는 긴 오류 스택 추적을 생성합니다. 이 시나리오에서는 대체 사용자 정의 짧은 메시지를 제공하거나 필요한 세부 사항을 희생하지 않고 출력 크기를 제한하는 것이 가장 좋습니다. 간결한 출력으로 출력 충실도의 균형.
returning () 함수의 출력으로 인해 OpenAI 모델이 함수가 다시 실행되도록 요청하여 잠재적으로 무한 루프로 이어질 수 있습니다.
이것은 실험적인 초기 단계 프로젝트입니다. 나노 앱은 위험 할 수 있으므로 구축하려는 것에주의하십시오. 컴퓨터에서 파괴적인 행동을 실행할 수 있습니다. 또한 예산을 염두에 두십시오. 사용중인 공급 업체를 모니터링하고 예산을 세우십시오. 나노 앱은 예기치 않게 긴 콘텐츠 또는 무한/너무 긴 루프를 생성하여 비용이 급등 할 수 있습니다.
이 소프트웨어는 MIT 라이센스에 따라 배포되며 여기에는 보증 부인이 포함됩니다. 또한 저자는이 실험 초기 프로젝트의 사용으로 인해 발생할 수있는 손상이나 비용에 대해 책임을지지 않습니다. 나노 앱을 자신의 위험으로 사용하십시오.