เมื่อเราวาดเส้นขนานระหว่างอินเทอร์เฟซการสนทนาของ GPT และเชลล์ของภาษาการเขียนโปรแกรม พรอมต์การห่อหุ้มสามารถมองได้ว่าเป็นการสร้างฟังก์ชัน ฟังก์ชันนี้มีชื่อเฉพาะ และเมื่อเราเรียกชื่อนี้ด้วยข้อความที่ป้อน มันจะสร้างผลลัพธ์ตามกฎภายในที่ตั้งไว้ โดยสรุป เราสร้างข้อความแจ้งที่ใช้ซ้ำได้พร้อมชื่อที่ทำให้มีส่วนร่วมกับ GPT ได้ง่าย เหมือนกับการมีเครื่องมือที่มีประโยชน์ที่ช่วยให้ GPT ดำเนินงานบางอย่างในนามของเราได้ เราเพียงแค่ต้องให้ข้อมูล จากนั้นเราก็จะได้รับผลลัพธ์ที่ต้องการ
ด้วยการห่อหุ้มพร้อมต์ไว้ในฟังก์ชัน คุณสามารถสร้างชุดฟังก์ชันเพื่อสร้างเวิร์กโฟลว์ได้ แต่ละฟังก์ชันแสดงถึงขั้นตอนหรืองานเฉพาะ และเมื่อรวมกันในลำดับเฉพาะ จะทำให้กระบวนการที่ซับซ้อนเป็นอัตโนมัติหรือแก้ปัญหาได้อย่างมีประสิทธิภาพมากขึ้น แนวทางนี้ช่วยให้มีการโต้ตอบกับ GPT ที่มีโครงสร้างและมีประสิทธิภาพมากขึ้น ซึ่งท้ายที่สุดแล้วจะเป็นการเพิ่มขีดความสามารถของ GPT และทำให้เป็นเครื่องมือที่มีประสิทธิภาพในการทำงานต่างๆ ให้สำเร็จลุล่วงได้
ดังนั้นก่อนที่เราจะใช้ฟังก์ชันได้ เราต้องแจ้งให้ GPT ทราบก่อน นี่คือพรอมต์ที่กำหนดฟังก์ชัน
Prompt:
มาเรียกพร้อมท์นี้ด้วย meta prompt พร้อมท์นี้ได้รับการทดสอบบน GPT3.5 และทำงานได้ดียิ่งขึ้นบน GPT4
Hello, ChatGPT! I hope you are doing well. I am reaching out to you for assistance with a specific function. I understand that you have the capability to process information and perform various tasks based on the instructions provided. In order to help you understand my request more easily, I will be using a template to describe the function, input, and instructions on what to do with the input. Please find the details below:
function_name: [Function Name]
input: [Input]
rule: [Instructions on how to process the input]
I kindly request you to provide the output for this function, based on the details I have provided. Your assistance is greatly appreciated. Thank you!
I will replace the text inside the brackets with the relevant information for the function I want you to perform. This detailed introduction should help you understand my request more efficiently and provide the desired output. The format is function_name(input) If you understand, just answer one word with ok.
เช่น สมมติว่าเราต้องการใช้ GPT เพื่อช่วยเราในการเรียนภาษาอังกฤษ เราสามารถทำให้กระบวนการง่ายขึ้นโดยการสร้างชุดฟังก์ชันต่างๆ
ตัวอย่างนี้ได้รับการทดสอบบน GPT3.5 และทำงานได้ดียิ่งขึ้นบน GPT4
เราจำเป็นต้องวาง meta prompt ที่กำหนดไว้เหนือส่วนใน GPT
จากนั้นเราจะสร้างฟังก์ชัน trans_word ฟังก์ชันนี้แจ้งให้ GPT แปลภาษาจีนเป็นภาษาอังกฤษ
Prompt:
function_name: [trans_word]
input: ["text"]
rule: [I want you to act as an English translator, spelling corrector and improver. I will provide you with input forms including "text" in any language and you will detect the language, translate it and answer in the corrected of my text, in English.]
เขียนฟังก์ชันที่ขยายข้อความ
Prompt:
function_name: [expand_word]
input: ["text"]
rule: [Please serve as a Chatterbox, spelling corrector, and language enhancer. I will provide you with input forms including "text" in any language, and output the original language.I want you to Keep the meaning same, but make them more literary.]
เขียนฟังก์ชันเพื่อแก้ไขข้อความ
Prompt:
function_name: [fix_english]
input: ["text"]
rule: [Please serve as an English master, spelling corrector, and language enhancer. I will provide you with input forms including "text", I want you to improve the text's vocabulary and sentences with more natural and elegent. Keep the meaning same.]
สุดท้าย คุณสามารถรันฟังก์ชันได้อย่างอิสระหรือโยงฟังก์ชันเข้าด้วยกัน
Prompt:
trans_word('婆罗摩火山处于享有“千岛之国”美称的印度尼西亚. 多岛之国印尼有4500座之多的火山, 世界著名的十大活火山有三座在这里.')
fix_english('Finally, you can run the function independently or chain them together.')
fix_english(expand_word(trans_word('婆罗摩火山处于享有“千岛之国”美称的印度尼西亚. 多岛之国印尼有4500座之多的火山, 世界著名的十大活火山有三座在这里.')))
ด้วยการแสดงฟังก์ชันในรูปแบบนี้ คุณจะเห็นชื่อของแต่ละฟังก์ชัน อินพุต และกฎในการประมวลผลอินพุตได้อย่างชัดเจน โดยให้วิธีการจัดระเบียบเพื่อทำความเข้าใจฟังก์ชันการทำงานและวัตถุประสงค์ของแต่ละขั้นตอนในเวิร์กโฟลว์
เคล็ดลับ: หากคุณไม่ต้องการให้ ChatGPT ส่งข้อมูลมากเกินไป คุณสามารถเพิ่มประโยคหลังจากกำหนดกฎของฟังก์ชันได้
DO NOT SAY THINGS ELSE OK, UNLESS YOU DONT UNDERSTAND THE FUNCTION
มาสร้างฟังก์ชันที่สร้างรหัสผ่านโดยใช้พารามิเตอร์อินพุต 5 ตัวและส่งออกรหัสผ่านที่สร้างขึ้น
Prompt:
function_name: [pg]
input: ["length", "capitalized", "lowercase", "numbers", "special"]
rule: [I want you to act as a password generator for individuals in need of a secure password. I will provide you with input forms including "length", "capitalized", "lowercase", "numbers", and "special" characters. Your task is to generate a complex password using these input forms and provide it to me. Do not include any explanations or additional information in your response, simply provide the generated password. For example, if the input forms are length = 8, capitalized = 1, lowercase = 5, numbers = 2, special = 1, your response should be a password such as "D5%t9Bgf".]
pg(length = 10, capitalized = 1, lowercase = 5, numbers = 2, special = 1)
pg(10,1,5,2,1)
ขณะนี้มีหลายโครงการที่กำลังดำเนินการเขียนโปรแกรม GPT เช่น:
แต่โปรเจ็กต์เหล่านั้นได้รับการออกแบบมาสำหรับลูกค้าผลิตภัณฑ์หรือสำหรับผู้ใช้ที่สามารถเขียนโค้ดด้วย Python หรือภาษาการเขียนโปรแกรมอื่นๆ สำหรับผู้ใช้ทั่วไป ใช้เทมเพลตง่ายๆ นี้สำหรับงานประจำวันและทำซ้ำสองสามครั้ง ใช้แอปพลิเคชันบันทึกเพื่อบันทึกฟังก์ชัน และยังสามารถอัปเดตเป็นไลบรารีได้ด้วย หรือใช้เครื่องมือ ChatGPT แบบโอเพ่นซอร์สบางอย่าง เช่น ChatGPT-Next-Web, chatbox, PromptAppGPT, and ChatGPT-Desktop สามารถใช้ได้. ปัจจุบัน ChatGPT-Next-Web อนุญาตให้เพิ่มภาพบางส่วนก่อนที่จะเริ่มต้นการแชทใหม่ และ PromptAppGPT รองรับการพัฒนาแอปพลิเคชันเว็บที่ใช้โค้ดน้อยตามเทมเพลตพร้อมท์ และช่วยให้ทุกคนสามารถพัฒนาแอปพลิเคชันที่คล้ายกับ AutoGPT ได้โดยใช้ข้อความแจ้งเพียงไม่กี่บรรทัด เราสามารถใช้คุณสมบัตินี้เพื่อเพิ่มฟังก์ชั่นของเราซึ่งก็สามารถใช้งานได้