أداة سطر الأوامر لتشغيل أوامر GPT. تدعم هذه الأداة المكونات الإضافية ذات الإضافات السريعة والسلسلة المسلحة و chatgpt.
استخدم هذه الأداة ل
ستحتاج إلى إنشاء مفتاح Openai API. إذا كان لديك حساب ، يمكنك إنشاء مفتاح هنا
https://platform.openai.com/account/api- keys
لا تشارك مفتاح API الخاص بك مع الآخرين ، أو تعرضه في المتصفح أو رمز آخر من جانب العميل. سوف تتحمل أي رسوم إذا كان شخص ما يستخدم مفتاحك. لا تحقق مفتاحك في أي مستودع عام.
قم بإنشاء ملف يحتوي على مفتاح API الخاص بك (الموجود أدناه ليس حقيقيًا). في مثالنا. نسمي الملف api_key ونضيف المفتاح.
sk-gKtTxOumv4orO6cfWlh0ZK
تأكد من تثبيت DART. اتبع التعليمات ، في الرابط أدناه.
https://dart.dev/get-mart
بعد التثبيت ، يمكنك تثبيت برنامج GPT مع الأمر التالي
DART PUB GLOBAL TISTRY GPT
فيما يلي حالات الاستخدام المدعومة
قم بتشغيل أمر Project
air genp
ستحتاج أولاً إلى تحديد النموذج الأصلي
? Project Archetype ›
❯ Prompt
Chain
Batch
Image
ChatGPT Plugin
أدخل اسم ProjectName و ProjectVersion
✔ Project Archetype · Prompt
✔ Project Name: · myproject
✔ Project Version: · 1.0
اعتمادًا على المشروع ، قد تحتاج إلى إدخال مفتاح API الخاص بك. يمكنك تخطي ملف مفتاح موجود أو إنشاء ملف مفتاح جديد
? Import Key ›
❯ Skip
Use Existing OpenAI API Key File
Create New OpenAI API Key File
يتيح لنا الخيار التالي إدخال مفتاح API مباشرة. سوف يحفظ المفتاح إلى ملف. إذا كنت تواجه مشكلة في نسخ المفتاح ولصقه ، فما عليك سوى إدخال بعض الأحرف ثم قم بتحرير الملف بعد ذلك.
✔ Import Key · Create New OpenAI API Key File
? API Key: › sk-gKtTxOumv4orO6cfWlh0ZK
يتيح لك مشروع ChatGpt Plugin القيام النماذج الأولية السريعة لمكون من chatgpt. على وجه التحديد ، يسمح لك بالسخرية من الاستجابات على chatgpt. يعتمد المشروع على مشروع QuickStart على: https://github.com/openai/plugins-quickstart
سيبدو ملف مشروعك
---
projectName : plugin-quickstart
projectVersion : ' 1.0 '
projectType : plugin
defaultConfig :
properties :
port : 5003
nameForHuman : TODO Plugin (no auth)
nameForModel : todo
descriptionForHuman : Plugin for managing a TODO list, you can add, remove and view your TODOs.
mockedRequests :
- path : " /todos/global "
method : get
mockedResponse : todos-global.json
- path : " /todos/user "
method : get
mockedResponse : todos-global.json
pluginServers :
- serverId : todo-mike
flavor : mike
# mocked requests
mockedRequests :
- path : " /todos/mike "
method : get
mockedResponse : todos.json # returns the content of this file
# Adds a different user for testing
- serverId : todo-kaleb
flavor : kaleb
mockedRequests :
- path : " /todos/kaleb "
method : get
mockedResponse : todos.json
properties :
showHttpHeaders : true # Show http headers in logsسيتم تطبيق أي تكوين في عقدة DefaultConfig على كل مكونات إضافية ما لم يتجاوز هذا المكون الإضافي الخاصية خاصية على وجه التحديد.
فيما يلي عينة من الاستجابة الساخرة ( TODOS.JSON ). سيتم إرجاع هذا في مكالمة إلى /todos /mike
{
"todos" : [
" Clean out a septic tank " ,
" Repair a broken sewer pipe " ,
" Collect roadkill for disposal " ,
" Assist in bee hive relocation " ,
" Service a grease trap at a restaurant "
]
}لبدء مثيل مسيرة لخادم البرنامج المساعد
air plugin
أو لبدء خادم معين ، أضف خيار ServerId
air plugin --serverId todo-mike
لمزيد من المعلومات حول إنشاء واستخدام chatgpt-plugin
إذا اخترت إنشاء مشروع صورة ، فسيتم طلب وصفك. لا تقلق ، يمكنك تغييره لاحقًا بعد إنشاء المشروع.
? Image Description: › A goldfish with big eyes
سيبدو ملف مشروعك
projectName : image-2
projectVersion : 2.0
apiKeyFile : api_key
blocks :
- blockId : image-block-1
pluginName : ImageGptPlugin
executions :
# First Image
- id : img-1
sizes :
- 256
- 256
- 1024
prompt : image.prompt
properties :
imageDescription : A goldfish with big eyesسيكون الملف السريع
Generate a picture of a ${imageDescription}
لمزيد من المعلومات حول الصور

ما يلي يسأل عدد المرات لتنفيذ بيانات الدُفعات. إذا اخترت 5 مرات ، فسيقوم بتشغيل جميع مكالمات بيانات الدُفعات 5 مرات لكل منها.
? Number of Times to Run The Block: › 5
سترى ملف مشروع مثل ما يلي
---
projectName : mybatch
projectVersion : 1.0
apiKeyFile : api_key
blocks :
- blockId : batch-1
pluginName : BatchGptPlugin
blockRuns : 5
configuration :
requestParams :
model : gpt-3.5-turbo
temperature : 0.7
top_p : 1
max_tokens : 500
executions :
- id : batch-1
dataFile : batch-data.json
prompt : batch.promptالمطالبة هي موجه عالم مرحبا
Write me a paragraph about the world I live in
World: ```${my_world}```
يحتوي ملف الدُفعات data.json على بيانات الدُفعات.
{
"my_world" : [
" Hello World, I live in a magical place with magical creatures " ,
" Hello World, I live in a futuristic Utopia " ,
" Hello World, I live in a futuristic Dystopia "
]
}قم بتعديل هذين الملفان مع بياناتك الخاصة. لمزيد من المعلومات حول الدُفعات
ما يلي يسأل عن عدد المرات لتشغيل طلب المطالبة. إذا اخترت 5 مرات ، فسيقوم بتشغيل جميع طلب المطالبة 5 مرات.
? Number of Times to Run The Block: › 5
بعد ذلك اختر تنسيق الإخراج. هل تريد فقط استجابة نصية مستقيمة ، أو هل تريدها بتنسيق JSON.
? Response Format ›
JSON
❯ TEXT
إذا اخترت JSON ، فسيتم سؤالك عما إذا كنت ترغب في تمكين إصلاح استجابة JSON. سيحاول هذا تحليل أي نص غريب قد يضيفه مساعد الذكاء الاصطناعي.
? Attempt to FIX JSON Responses? (y/n) › no
سيبدو ملف المشروع
---
projectName : prompt-1
projectVersion : 1.0
apiKeyFile : api_key
blocks :
- blockId : single-1
pluginName : ExperimentGptPlugin
blockRuns : 5
configuration :
requestParams :
model : gpt-3.5-turbo
temperature : 1.2
top_p : 1
max_tokens : 500
executions :
- id : exp-1
responseFormat : json
fixJson : false
promptChain :
- prompt-json.prompt
properties :
character : Commander in Starfleet
mainCharacterName : ' '
- blockId : report-1
pluginName : ReportingGptPlugin
executions :
- id : report-1
blockIds :
- single-1يتضمن الملف بعض القيم الافتراضية لطلبات OpenAI. قم بتغييرها لتناسب احتياجاتك. بشكل افتراضي ، يضيف أيضًا المكون الإضافي للإبلاغ الذي أنشأ إخراج HTML من استجابة المستخدم/المساعد.
المراوغة json.prompt يشبه ما يلي. لاحظ كيف يحدد الإخراج لاستخدام JSON. قم بتعديل المطالبة والخصائص لاحتياجاتك.
Write me a story about ${character}. The main character is ${mainCharacterName}.
If no main character is given, choose one. Write one sentence only.
The response should be in JSON using the following structure:
Only use these fields. {"mainCharacterName": "", "story": ""}
لمزيد من المعلومات حول المطالبات
اختر سلسلة سلسلة المشروع. ثم انتقل من خلال الخيارات.
? Number of Times to Run The Block: › 1
? Attempt to FIX JSON Responses? (y/n) › yes
? Number of Times to Run The Prompt Chain: › 2
ملف project.yaml الذي تم إنشاؤه.
---
projectName : " chain-project "
projectVersion : " 1.0 "
apiKeyFile : " api_key "
blocks :
# Block demonstrates the use of importing properties
- blockId : chain-1
pluginName : ExperimentGptPlugin
blockRuns : 1 # Number of Stories
configuration :
requestParams :
model : gpt-3.5-turbo
temperature : 1.2
top_p : 1
max_tokens : 500
executions :
- id : exp-1-import
chainRuns : 2 # Number of times to run the promptChain
promptChain :
- story.prompt
- user-action.prompt # Simulates user input
excludesMessageHistory :
- user-action.prompt
fixJson : true
responseFormat : json
# Import properties from a properties file
import :
propertiesFile : properties.json # predefined values
properties :
planet : 1 # Earth
action : 3 # Lands on the planet
- blockId : report-1
pluginName : ReportingGptPlugin
executions :
- id : report-1
blockIds :
- chain-1إن حقول الممتلكات في ملف Project.yaml أعلاه إلى الفهرس ضمن ملف Properties.json أدناه. يتيح لك هذا الملف تغيير إدخال الاختبار بسهولة.
{
"planet" : [
" Earth " ,
" Venus " ,
" Jupiter "
],
"action" : [
" Blows up the planet " ,
" Observes the planet From Orbit " ,
" Lands on the planet " ,
" Zips around the planet and hopes no one notices "
]
}ستقوم الأداة باستبدال الكوكب "الأرض" وتهبط العمل "على الكوكب" في موجه القصة أدناه. لاحظ أن الذكاء الاصطناعى سوف يولد اسم الشخصية والفقرة الأولى من القصة.
The response will be in JSON Format.
Captain ${captainsName} is near ${planet}. .
The last part of the story is: ${story}
Then the captain ${action}
Tell me a story about what happens next.
Be very descriptive. Write two sentences only.
Give me the captains name, if I haven't given it.
RESPONSE
The response must only be in JSON using the following structure.
Only use these fields. {"captainsName": "${captainsName}", "story": ""}
ستقوم الأداة الآن بتمرير اسم القبطان الذي تم إرجاعه والقصة من الموجه الأول إلى action-action.prompt . سنعود إلى إجراء تتخذه الشخصية.
Give me an action for ${captainsName} for the following story:
${story}
The response must be in JSON using the following structure.
Only use these fields. {"action": ""}
الآن سندير القصة .
ما يلي هو إخراج العينة من التشغيل الفعلي
As Captain John lands on the planet, he feels the trembling beneath his feet and sees the vibrant green flora around him.
He plants the Earth's flag to claim its new discovery and soon finds a thriving alien civilization welcoming him with open arms.
[user action "plants the flag to claim the new discovery"]
As Captain John plants the Earth's flag on the newfound planet, he is approached by the leaders of the alien civilization
who speak his language and reveal that they have known about Earth for centuries. They invite him to partake in a feast in
his honor, where he learns about their advanced technology and way of life.
لاحظ أن تشغيل السلسلة هو نفس عدد الفقرات التي لدينا في الإخراج. إذا أردنا فقرة أخرى ، فسنقوم بتعيين سلسلة سلسلة على 3. إذا كنا قد وضعنا blockruns على 5 ، لكنا قد أنشأنا 5 قصص مختلفة.
لمزيد من المعلومات حول السلاسل
لإنشاء تقرير HTML ، أضف ReportingGptPlugin باعتباره الكتلة الأخيرة. ضمن blockids إضافة أي معرف كتلة سابق تريد إضافته إلى التقرير الذي تم إنشاؤه.
---
projectName : experiment-reporting
projectVersion : ' 1.7 '
apiKeyFile : " ../../api_key "
blocks :
- blockId : chain-1
pluginName : ExperimentGptPlugin
blockRuns : 1
...
# Generate HTML Report
- blockId : report-1
pluginName : ReportingGptPlugin
executions :
- id : report-execution
blockIds :
- chain-1 سيعرض التقرير الدردشة بأكملها لعمليات إعدام الكتلة التي تم تكوينها.

لمزيد من المعلومات حول الإبلاغ
الهواء -المساعدة
A command line tool for running GPT commands
Usage: air <command> [arguments]
Global options:
-h, --help Print this usage information.
Available commands:
clean Cleans project's output directory
count Returns the number of OpenApiCalls that would be made
genp Generates a new project
plugin Runs local version of ChatGPT Plugin
run Runs a project's blocks
Run "air help <command>" for more information about a command.
لتنظيف المشروع ، قم بتشغيل ما يلي
الهواء نظيف
هذا يحذف دليل الإخراج للمشروع.
يمكن أن يكون تشغيل مكالمات Openai باستخدام أداة مكلفة إذا أسيء تكوينها. لتحديد عدد مكالمات Openai التي سيقوم بإنشائها ، قم بتشغيل الأمر التالي
عدد الهواء
أو لعدد كتلة معينة
عدد الهواء -b myblockid
سوف يخرج
Project: product-summary-2.8
Total OpenAPI Calls would be 12
إذا كنت تريد أن تعرف أن مشروعك يفعل قبل تكبد التكاليف إلى Openai ، فاستخدم علامة Drirun.
تشغيل الهواء -ديجرون
Executing Block
Running Project: image-generation-2.3
BlockId: image-1, PluginName: ImageGptPlugin
----------
Starting Block Run: 1
Starting execution: 1 - Requires 1 calls to OpenAI
POST to https://api.openai.com/v1/images/generations
{"prompt":"Generate a picture of a Unicorn with a gold horn and wings","n":1,"size":"256x256","response_format":"url"}
Finished execution: 1
Starting execution: 2 - Requires 2 calls to OpenAI
POST to https://api.openai.com/v1/images/generations
{"prompt":"Generate a picture of a fish with giant eyes","n":1,"size":"256x256","response_format":"b64_json"}
POST to https://api.openai.com/v1/images/generations
{"prompt":"Generate a picture of a fish with giant eyes","n":1,"size":"512x512","response_format":"b64_json"}
Finished execution: 2
--------
Finished running project: 0 seconds