تطبيقات نانو هي تطبيقات صغيرة يمكن تضمينها في روبوتات النانو. مثلما يمكن للبشر تضخيم قدراتهم مع إمكانية الوصول إلى أدوات مثل وجع أو آلة حاسبة أو قارئ الشاشة أو الوصول إلى الإنترنت ، يمكن لوباء النانو تعزيز قدراته عند تجهيزه بتطبيقات نانو.
يمكن كتابة تطبيقات Nano في Lua أو الشمر أو Clojure. اختار هذا المستودع المحدد استخدام Clojure لتطبيقات Nano.
تثبيت وإعداد نانو روبوت 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 Octave للرياضيات الحسابية والرمزية ، بما في ذلك العمليات الأساسية والحسابات المعقدة مثل المشتقات والتكامل.
تثبيت GNU Octave:
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.
?> |
يوفر PlayerCTL للسيطرة على مشغلات الوسائط الذين يقومون بتنفيذ مواصفات واجهة MPRIS D-BUS.
تثبيت 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.
?> |
☠ تحذير: قد ينفذ هذا التطبيق النانو العمليات الخطيرة والمدمرة على النظام ؛ كن حذرا معها.
يوفر وسيلة للتفاعل مع نظام الكمبيوتر والبيانات عن طريق تنفيذ أوامر shell ، على غرار تلك المستخدمة في محطة Linux. يمكنه إرسال أوامر إلى البرمجيات واستخراج المعلومات وإجراء إجراءات مختلفة.
أمثلة:
?> 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 : رمز مصدر تطبيق Nano.specification.yml : مواصفات تطبيق Nano لـ Nano Bot.test.clj : اختبارات لتطبيق Nano.بالإضافة إلى ذلك:
README.md : A README للبشر ، لا تستخدم في مكان آخر ، فقط لتعزيز هذه القراءة.من قالب أساسي ، قم بإنشاء خرطوشة مع جميع تطبيقات Nano بما في ذلك:
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بعد إنشاء خرطوشة ، بالنظر إلى أن لديك روبوتات نانو ، يمكنك تجربتها على الفور:
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 خدعة لتحديث README.md تلقائيًا عند تغيير template.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 ; doneخدعة لمعاينة Live Morkdown:
pip install -U markdown_live_preview
mlp README.md -p 8076bb tasks/cljfmt-fix.clj يمكنك إنشاء تطبيقات نانو خاصة لن تكون ملتزمة بالمستودع باستخدام user@app :
apps/your-name@your-app/app.clj
الأمر نفسه ينطبق على قوالب الخرطوشة الخاصة:
cartridges/[email protected]
يمكنك استبعاد تطبيقات Nano الخاصة بك من توليد الخرطوشة مع:
bb tasks/generate-cartridge.clj cartridges/template.yml cartridge.yml --no-privateتشغيل جميع الاختبارات ، باستثناء تطبيقات النانو الخاصة:
bb tasks/run-tests.clj --no-private تم تصميم تطبيقات Nano كجزء من روبوتات النانو ، لذلك من المهم التعرف على مواصفات ومبادئ برامج النانو: مواصفات نانو روبوتات
يعد تطبيق Nano جيدًا مثل قدرة مزود الذكاء الاصطناعي على الاستفادة منه. لذلك ، كمبدأ أساسي ، ينبغي النظر في كل ما تعلمته عن الهندسة الفريدة وتطبيقه على تطوير تطبيقات النانو ، خاصة عند كتابة مواصفاتها:
في بعض الأحيان ، قد تشعر ، "هذا معقد للغاية" ، أو "لن يكون مفيدًا" ، أو "لماذا ستستخدم هذا" ، وما إلى ذلك. قد تفاجأ بالطرق الإبداعية التي تستخدمها تطبيقات النانو بواسطة النماذج.
للحصول على مثال ملموس ، فإن التحكم في لاعب الوسائط لديه أوامر قد تعتقد أنها لا تستحق تقديمها. ولكن ، إذا كنت تقضي بعض الوقت في اللعب ، فستواجه العديد من اللحظات "Wow" حول كيفية استخدامه النموذج لتحقيق ما تطلبه.
لذا ، امنحها مساحة لتكون مبدعًا واستكشافها ، لا تتراجع عن الوظائف لمجرد أنك تشعر بأنك غير متأكد.
على الرغم من أن LLMs أصبحت قادرة بشكل متزايد على التعامل مع كميات كبيرة من البيانات ، إلا أننا نحتاج إلى النظر في ما يلي عندما يتعلق الأمر بالرموز:
تجنب توفير مخرجات طويلة غير ضرورية ؛ اغتنم الفرصة لجعل مخرجاتك موجزة. كن حذرًا عند إنشاء تطبيقات Nano التي تستفسر عن قواعد البيانات أو تشغيل الأوامر ، حيث يمكنها إنتاج مخرجات طويلة بشكل غير متوقع.
عند استخدام تطبيقات Nano كبديل للبرامج الشائعة ، تأكد من أن الإخراج مخلص للبرنامج الفعلي. تسبب النماذج بشكل أفضل عندما يكون الإخراج هو بالضبط ما يتوقعه من البرنامج.
على سبيل المثال ، إذا كان تطبيق Nano الخاص بك بمثابة وكيل لبرنامج GNU Octave ، فسيكون الإخراج المتوقع للعمليات هو:
ans = 6
قد يكون من المغري تقصيره للعودة 6 فقط بدلاً من ans = 6 . لا تفعل ذلك حافظ على الإخراج الأصلي ، حيث كان ما تعلمه النموذج يتوقعه أثناء تدريبه.
حافظ على أخطاء موجزة (مخرجات موجزة) ومفيدة (هندسة سريعة).
عند استخدام تطبيقات NANO كبديل للبرامج الشائعة ، حدد الأولوية لمشاركة إخراج الخطأ الأصلي من البرنامج (FUTTION FIDELITY). بعض البرامج تنشئ آثار مكدس خطأ مطولة. في هذا السيناريو ، من الأفضل توفير رسائل قصيرة مخصصة بديلة أو تقييد حجم الإخراج دون التضحية بالتفاصيل اللازمة. توازن الإخلاص الإخراج مع المخرجات الموجزة.
يمكن أن يتسبب الإرجاع () كإخراج الوظيفة إلى أن تطلب نماذج OpenAI أن تعمل الوظيفة مرة أخرى ، مما قد يؤدي إلى حلقة لا حصر لها.
هذا مشروع تجريبي في المرحلة المبكرة. قد تكون تطبيقات Nano خطيرة ، لذا كن حذرًا فيما تحاول بناءه ؛ يمكنهم تنفيذ الإجراءات المدمرة على جهاز الكمبيوتر الخاص بك. أيضًا ، كن على دراية بميزانيتك: تأكد من مراقبة وميزانية أي مزود تستخدمه. قد تنتج تطبيقات Nano محتوى طويلًا بشكل غير متوقع أو حلقات لا حصر لها/طويلة جدًا قد تتسبب في ارتفاع تكاليفك.
يتم توزيع هذا البرنامج بموجب ترخيص معهد ماساتشوستس للتكنولوجيا ، والذي يتضمن إخلاء المسؤولية عن الضمان. علاوة على ذلك ، لا يتحمل المؤلفون أي مسؤولية عن أي ضرر أو تكاليف قد تنشأ عن استخدام هذا المشروع التجريبي في المرحلة المبكرة. استخدم تطبيقات Nano على مسؤوليتك الخاصة.