Skip to content

Commit bc72cff

Browse files
committed
prompt engineering
1 parent 62c8375 commit bc72cff

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

examples/next-openai/src/app/components/vacation-notes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export function VacationNotes(): JSX.Element {
1313
onValueChange={(value: string) => setText(value)}
1414
placeholder="What are your plans for your vacation?"
1515
autosuggestionsConfig={{
16-
textareaPurpose: "Notes for my upcoming vacation",
16+
textareaPurpose:
17+
"Travel notes from the user's previous vacations. Likely written in a colloquial style, but adjust as needed.",
1718
debounceTime: 0.7,
1819
acceptAutosuggestionKey: "Tab",
1920
contextCategories: [],

packages/react-textarea/src/types/autosuggestions-config.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ export const defaultMakeSystemMessage: MakeSystemMessage = (
2222
contextString
2323
) => {
2424
return `
25-
You are a hyper-competent and versatile writing assistant.
25+
You are a versatile writing assistant.
2626
2727
The user is writing some text. The purpose is: ${textareaPurpose}.
2828
Your job is to help the user write - by guessing what they are going to write next as best as you can, and suggesting it to them.
2929
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
3030
31-
Infer from context WHAT the user is likely writing (and WHY they are writing it) -- and adapt accordingly.
32-
You should also adapt to the user's writing style as best you can. If the user content is formal, be formal; if the user content is casual, be casual; etc.
31+
Adjust yourself to the user's style and implied intent.
3332
3433
The user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.
3534
<TextAfterCursor>
@@ -38,7 +37,7 @@ The user will provide both the text before and after the cursor. You should use
3837
3938
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
4039
41-
The following external context is also provided. You may draw on it when appropriate.
40+
The following external context is also provided. Draw on it whenever it is relevant!
4241
\`\`\`
4342
${contextString}
4443
\`\`\`

0 commit comments

Comments
 (0)