SysPmt
v1.0.0
SYSPMT는 파이썬과 같은 구문으로 작성된 의사 코드를 LLMS (Lange Language Models)에 대한 정확하고 실행 가능한 시스템 프롬프트로 변환하도록 설계된 파이썬 기반 도구입니다. 이 도구는 프로그래밍에 능숙하지만 LLM에 대한 효과적인 시스템 프롬프트를 제작하는 데 도움이 필요한 개발자와 신속한 엔지니어를 돕기위한 것입니다.
SYSPMT는 yaml 구성에 정의 된 매핑을 사용하여 의사 코드 파일 ( .pmt )과 구성 파일 ( .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.'.
기부금을 환영합니다! 저장소를 포크하고 수정하고 검토 요청을 제출하십시오.