Skip to content

Commit 0f25466

Browse files
committed
Tidy up the prompt gen logic
1 parent 5f2b90a commit 0f25466

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

pkg/generate/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
func GeneratePrompt(purpose, theme, demographics, interests string, size, length int) (string, error) {
1111
data := promptData{
1212
Purpose: purpose,
13+
Theme: theme,
1314
Demographics: demographics,
1415
Interests: interests,
15-
Theme: theme,
1616
MaxSize: size,
1717
MaxLength: length,
1818
}

pkg/generate/template.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const promptName = "name_brainstorm_with_json"
55

66
// promptData is the input for the prompt template.
77
type promptData struct {
8-
Purpose string
9-
Demographics string
10-
Interests string
11-
Theme string
12-
MaxSize int
13-
MaxLength int
8+
Purpose string // Project purpose
9+
Theme string // Project theme
10+
Demographics string // Target demographics
11+
Interests string // Target interests
12+
MaxSize int // Maximum number of names to generate
13+
MaxLength int // Maximum length of each name
1414
}
1515

1616
// promptTemplate is a Go template for prompting.
@@ -38,14 +38,14 @@ array element, anywhere between 1.0 and 10.0.
3838
The JSON output should adhere to the following structure:
3939
4040
[
41-
{
42-
"name": "Generated Name",
43-
"explanation": "Explanation of fit...",
44-
"firstImpressions": "First impressions...",
45-
"pros": ["Pro 1", "Pro 2"],
46-
"cons": ["Con 1", "Con 2"],
47-
"additionalThoughts": "Any other thoughts...",
48-
"suitabilityScore": 1.0
49-
}
41+
{
42+
"name": "Generated Name",
43+
"explanation": "Explanation of fit...",
44+
"firstImpressions": "First impressions...",
45+
"pros": ["Pro 1", "Pro 2"],
46+
"cons": ["Con 1", "Con 2"],
47+
"additionalThoughts": "Any other thoughts...",
48+
"suitabilityScore": 1.0
49+
}
5050
]
5151
`

0 commit comments

Comments
 (0)