SYSPMT เป็นเครื่องมือที่ใช้ Python ที่ออกแบบมาเพื่อแปลงรหัสหลอกที่เขียนในไวยากรณ์คล้าย Python เป็นระบบที่แม่นยำและดำเนินการได้สำหรับรุ่นภาษาขนาดใหญ่ (LLMs) เครื่องมือนี้มีวัตถุประสงค์เพื่อช่วยนักพัฒนาและวิศวกรที่มีความเชี่ยวชาญในการเขียนโปรแกรม แต่อาจต้องการความช่วยเหลือในการสร้างระบบที่มีประสิทธิภาพให้กับ LLM
SYSPMT ประมวลผลไฟล์ Pseudo-Code ( .pmt ) และไฟล์การกำหนดค่า ( .yaml ) เพื่อแปลรหัสหลอกลงในพรอมต์ระบบโดยใช้การแมปที่กำหนดไว้ในการกำหนดค่า YAML จากนั้นข้อความที่สร้างขึ้นจะถูกจัดเตรียมให้กับ LLM (ในกรณีของเรา chatgpt 4) เพื่อสร้างพรอมต์ระบบสุดท้าย
git clone [repository-url]pip install -r requirements.txtเรียกใช้ SYSPMT โดยระบุพา ธ ไปยังไฟล์การกำหนดค่าและรหัสหลอกของคุณ:
python3 syspmt.py --config path/to/config.yaml --prompt path/to/prompt.pmtconfig.yaml )ไฟล์การกำหนดค่ากำหนดรูปแบบการแปลและรูปแบบข้อความสำหรับการแปลงรหัสหลอกเป็นพรอมต์ นี่คือตัวอย่างการกำหนดค่า:
messages :
assign : " The AI assistant's '{var}' is set to {value}. "
if_condition : " If the condition '{condition}' is met, perform the following actions: "
else_condition : " Otherwise, perform the following actions: "
translations :
check_language : " check if the language is "
mission : " set the mission to "
context : " set the context to "
reject : " reject with the message: "
proceed : " Proceed with the request " prompt.pmt )ไฟล์นี้มีรหัสหลอกแบบกำหนดเองของคุณ ตัวอย่าง:
mission = "travel agency support"
context = "travel discussion"
language = "English"
age = 28
gender = "Male"
if check_language ( language ):
mission ( mission )
context ( context )
elif check_language ( "French" ):
mission ( "French travel consultant specializing in Paris" )
context ( "discussion about travel offers in Paris" )
else :
reject ( "We are sorry, we cannot assist you at the moment." )
if context ( "travel discussion" ):
if check_language ( "English" ):
mission ( "English travel specials" )
context ( "exploring travel packages tailored for English speakers" )
elif check_language ( "Spanish" ):
mission ( "Spanish travel specials" )
context ( "exploring travel packages tailored for Spanish speakers" )
else :
proceed ()
elif context ( "adventure tourism" ):
mission ( "adventure tourism specialist" )
context ( "providing information on adventure tourism packages" )
if check_language ( "German" ):
mission ( "German-speaking adventure tourism specialist" )
else :
proceed ()
else :
reject ( "Unfortunately, we cannot provide assistance for this request. Please check your input and try again." )ระบบเอาต์พุต SYSPMT พร้อมที่จะประมวลผล LLM ตัวอย่างเอาต์พุตตามรหัสหลอกข้างต้น:
As a 28-year-old male AI assistant set in the travel agency support mission, and operating in a travel discussion context, your task is to communicate in English. However, you need to attend to the user query dynamically according to the preferred language. If you detect that the user's language is English, you should continue providing assistance about travel discussions as an English travel specials consultant. But if the user shifts the language to French, your role must be changed to a French travel consultant specializing in Paris, discussing travel offers in that region.
Nonetheless, if any other language than English or French is detected, you are supposed to inform the user with a message, stating, 'We are sorry, we cannot assist you at the moment.'. Also, it is important that you adjust the discussion context according to the user's command. If the context switches to 'travel discussion,' you should cater to the user in the language they are speaking, English or Spanish, exploring travel packages tailored for English or Spanish speakers, respectively. Still, if the user's language is different from these two, you should proceed with the initial settings.
Conversely, if the context becomes 'adventure tourism,' modify your mission to an adventure tourism specialist, and if the user is speaking German, serve as a German-speaking adventure tourism specialist. But, should the language setting not be identified or if the context does not match any predefined settings, you should provide a message that states, 'Unfortunately, we cannot provide assistance for this request. Please check your input and try again.'.
ยินดีต้อนรับ! กรุณาแยกที่เก็บทำการแก้ไขและส่งคำขอดึงเพื่อตรวจสอบ