## 0. 프롬프트 기법?
- `프롬프트` : 사전적인 의미로는 '연극에서 배우에게 대사나 동작을 지시하는 행위', 현재는 AI에게 동작을 지시하는 행위를 뜻함.
- `프롬프트 기법` : 프롬프트 엔지니어링이라고도 불림. 프롬프트를 잘 만드는 방법. 개인적으로 엔지니어링은 과분한 단어라고 생각함.
## 1. 예시 주기
```
이름 : 홍길동
삼행시:
홍 - 홍수처럼 밀려오는
길 - 길게 늘어진
동 - 동백나무 숲
이름 : 김갑환
```
## 2. 역할 주기
```
I want you to act as [ 역할 ]. Your name is [ 이름 ]. I will [ 나의 행동 ] and you will [ AI가 해야 할 행동 ]. ...
```
```
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. When I need to tell you something in English, I will do so by putting text inside curly brackets {like this}. My first command is pwd
```
## 3. 마크다운으로 출력 형식 지정
```
# 명령문
# 조건
-
-
# 입력문
-
# 출력형식
[]([]) : []([])
```
```
# Order
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show as according to the following constraints
# Constraints
- only reply with the terminal output inside one unique code block, and nothing else
- do not write explanations.
- do not type commands unless I instruct you to do so.
- When I need to tell you something in English, I will do so by putting text inside curly brackets {like this}
- My first command is pwd
-
# Input
- pwd
# Output type
[Your name] : [your reply]
```
## 4. 마크다운으로 CLI 형식 사용
```
# Variables
[Word] = "Cheese"
...
# Command
[CMD1] = tell me about [Word]
[CMD2] = ...
# Run
$ run [CMD1] [CMD2]
```
## 5. 빈 칸 채우기
```
# Order
I want you to act like a web server developer. I will give you the code I wrote under the "Reference". And I'll give you a code that includes "[blank]" under the "Input". Then you can refer to the "Reference" code and fill in "[blank]" according to the following constraints.
# Constraints
- only reply with the output inside one unique code block, and nothing else
- do not write explanations
# Reference
import lombok.*;
@Getter
@Setter
@Entity
@Builder
@EntityListeners(AuditingEntityListener.class)
public class Post {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="post_id", updatable = false)
private int id;
private String content;
private String title;
@CreatedDate
@Column(name = "posted_date")
private LocalDateTime postedDate;
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "user_id")
private Users user;
}
# Input
import lombok.*;
[blank]
public class PostRequestDTO {
[blank]
public [blank] toEntity([blank]){
[blank]
}
}
# Output type
[output code]
```
## 6. [사고의 연쇄](https://plainenglish.io/blog/chatgpt-prompt-engineering-lets-think-step-by-step-and-other-magic-phrases)