Gemma 리눅스 명령 교정 프로젝트 1: 프롬프트 샘플 작성

리냥·2024년 5월 12일
0

기본
명령과 컨텍스트 분리
프롬프트는 구조적으로 작성해야 함
[CONTEXT]
user로부터 입력되는 명령은 우분투에서 사용하는 기본 명령 또는 git이나 docker처럼 별도의 튜유틸리티의 애플리케이션이나 명령입니다.
하지만 user의 명령은 잘못 입력되어 오류가 난 입력입니다.
아래의 [STEP]에 따라 명령을 수정하세요.

[STEP]
1. check : 유저의 명령이 진짜 틀린 건지 확인합니다. 틀린 점이 있다면, true, 없다면, false를 출력해주세요.
2. incollect_point: 만약 틀린 경우, 틀린 위치를 *로 감싸서 알려주세요. {예: aptget install docker -> apt get install docker}. 틀리지 않았다면 null을 출력하세요.
3. incollect_reason: 2.에서 발견한 틀린 위치가 왜 틀렸는지 알려주세요. {예: aptget install docker ->
apt get* install docker -> "aptget"이 아니라 apt-get입니다.}
4. fixed_command: 3.에서 틀린 이유에 따라 맞는 명령으로 수정해주세요. 만약 틀린 1.에서 check한 결과가 틀리지 않은 것으로 나왔으면, user의 입력을 그대로 출력하세요.

//만약 여기서 하게 되면 줄글로 나오게 됨
따라서 out명령 따로 만듦//

[OUTPUT]
format : json
{{
"incollected_command": <user_input>,
"check": {{{{true|false}}}}},
"incollect_point": <incollect_point|null>,
"incollect_reason" : <incollect_reason|null>,
"fixed_command" : <fixed_command>
}}

[INSTRUCTION][CONTEXT]에서 설명하는 방법대로 [INCOLLECTE COMMAND]를 올바른 명령으로 수정해서 [OUTPUT]에서 정한 포맷으로 출력하세요.

(2)

[CONTEXT]에서 설명하는 방법대로 아래의 잘못된 명령을 올바른 명령으로 수정하세요.
---하이퍼로 구분
user: aptget install docker
assistant:{{
"incollected_command": "aptget install docker",
"check": true,
"incollect_point": aptget install docker,
"incollect_reason" : ""aptget"이 아니라 apt-get입니다.",
"fixed_command" : "apt-get install docker"
}}
//영어로 바꾸기.한계가 있음.


user: git comit -m "message"
assistant: {{
"incollected_command": "git comit -m \"message\"",
"check": true,
"incollect_point": "git comit -m \"message\"",
"incollect_reason" : ""comit"이 아니라 commit입니다.",
"fixed_command" : git commit -m "message"
}}


user:{command}
assistant:


이 예시는 많이 줄 수록 좋음

CoT
chain of Tought
LLM의 답변이 다시 LLM의 입력 -> 답변이 컨텍스트를 만들어 컨텍스트를 풍성하게 해줌

Zero Shot Cot
질문
대답
Let's Think step by step
대답
Let's Think step by step

ex.
서울지하철역 개수
1호선 역 개수
2호선
sum

멀티턴
질문=>순서
순서1
순서1 대답
순서1 질문 순서1 대답 순서2 질문
순서2 대답
순서1 질문 순서1 대답 순서2 질문 순서2 대답 순서3 질문
이런 식으로 느리기에 single turn

싱글 턴

[CONTEXT]
The commands entered from the user are the basic commands used by Ubuntu, or the applications or commands of a separate TU utility, such as git or docker.
However, the user's command is an erroneous input because it was entered incorrectly.
Follow [STEP] below to modify the command.

[STEP]
1. check : make sure the user's command is really wrong. If there is something wrong, please print true, if not false.
2. collect_point: If you are wrong, please let me know by wrapping the wrong location with *. {e.g., aptget install docker -> apt get install docker}. If you are not wrong, print null.
3. Please tell me why the wrong location found in collect_reason: 2. is incorrect. {Example: aptget install docker ->
apt get* install docker -> apt-get, not "aptget."}
4. Please correct the correct command according to the wrong reason in fixed_command: 3. If the check result in incorrect 1. is not wrong, output the user's input as it is.

[OUTPUT]
format : json
{{
"incollected_command": <user_input>,
"check": {{{{true|false}}}}},
"incollect_point": <incollect_point|null>,
"incollect_reason" : <incollect_reason|null>,
"fixed_command" : <fixed_command>
}}

[INSTRUCTION]

Correct [INCOLECTION COMMAND] to the correct command and output it in the format specified in [OUTPUT] as described in [CONTEXT].

user: git comit -m "message"
assistant: {{
"incollected_command": "git comit -m \"message\"",
"check": true,
"incollect_point": "git comit -m \"message\"",
"incollect_reason" : ""comit"이 아니라 commit입니다.",
"fixed_command" : git commit -m "message"
}}


user:{command}
assistant:

profile
안녕하세요. 일로 인해 잠시 쉽니다 :)

0개의 댓글