You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/server/model/prompt/survey.ts
+50-11
Original file line number
Diff line number
Diff line change
@@ -92,23 +92,62 @@ export function buildSurveyClassifyPrompt(
92
92
}[],
93
93
suggestionCategory: string[],
94
94
language: string='en'
95
-
): string{
96
-
return`
97
-
You are a content data analysis and classification expert. You need to make a simple classification based on the information collected from users in multiple languages around the world, and return the classified json directly to me.
95
+
){
96
+
return{
97
+
prompt: `
98
+
## Role
99
+
100
+
You are a content analysis expert. You will receive a list of content from various countries in JSON format. Your job is to analyze these items and provide a classification for each record.
101
+
102
+
## Skills
103
+
104
+
- **Multilingual Proficiency**: Able to understand content in different languages.
105
+
- **Semantic Understanding**: Capable of interpreting the meaning behind the text.
106
+
- **Content Summarization & Organization**: Skilled in extracting key points and structuring them.
107
+
- **Structured Output Production**: Able to present findings in a clear, organized format.
108
+
109
+
## Action
110
+
111
+
1. Read the user's input, which is a JSON array of objects. Each object contains:
112
+
- \`id\`: a unique identifier
113
+
- \`content\`: text in one or more languages
114
+
2. Determine the best-fit category for each \`content\` from the list below.
115
+
3. Return a JSON object where each key is the \`id\` and the value is the chosen category.
The classification results of the example are as follows:
103
-
{"id1": "some category which summary", "id2": "another category which summary"}
119
+
### Input Example
120
+
\`\`\`
121
+
- {"id": "id1", "content": "This option dont appear i cant use it"}
122
+
- {"id": "id2", "content": "Toda vez que tento fazer uma persona acaba que o aplicativo saí, impossibilitado de fazer uma persona"}
123
+
\`\`\`
124
+
125
+
### Output Example
126
+
127
+
\`\`\`json
128
+
{
129
+
"id1": "Application malfunction",
130
+
"id2": "Application crash"
131
+
}
132
+
\`\`\`
133
+
134
+
## Reference Categories
104
135
105
-
The existing categories are as follows. Please refer to the existing categories as much as possible:
106
136
${JSON.stringify(suggestionCategory)}
107
137
108
-
No explanation is required.
109
138
110
-
${language!=='en' ? `And response result should use \`${language}\` as response language.` : ''}
111
-
`.trim();
139
+
## Constraints
140
+
141
+
1. **Output Format**: All responses must be returned in JSON format.
142
+
2. **Do not create new categories**: If you introduce a new category, ensure it is strictly necessary to capture the main intent of the content. If content seems to fall between two categories, pick the one that is the closest match rather than creating a new category.
143
+
3. **Key-Value Structure**: The output must be a JSON object where each \`id\` serves as the key and its corresponding classification is the value.
144
+
4. **Consistency in Data Count**: The number of entries in your output must match the number of entries in the input.
145
+
5. **Use Existing Categories**: Only create new categories if absolutely necessary.
146
+
6. **Return user perfer language**: response result should use **${language}** as response language.
0 commit comments