Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,20 @@ Step 2:
|
|
| 23 |
For each part, also see if there is a common length and strucutre.
|
| 24 |
Step 3:
|
| 25 |
Describe each of the parts, so a skilled copywriter could take those and use them as instructions to write about another product
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
**Reference Copy:**
|
| 28 |
{combined_references}
|
| 29 |
|
|
@@ -32,7 +45,7 @@ Generate the final structured template that adheres to these guidelines.
|
|
| 32 |
|
| 33 |
# Call the OpenAI API using the new ChatCompletion interface
|
| 34 |
response = openai.ChatCompletion.create(
|
| 35 |
-
model="
|
| 36 |
messages=[
|
| 37 |
{"role": "system", "content": "You are a helpful assistant that generates structured e-commerce copywriting templates."},
|
| 38 |
{"role": "user", "content": prompt}
|
|
|
|
| 23 |
For each part, also see if there is a common length and strucutre.
|
| 24 |
Step 3:
|
| 25 |
Describe each of the parts, so a skilled copywriter could take those and use them as instructions to write about another product
|
| 26 |
+
Step 4:
|
| 27 |
+
For each part, turn it into our templating language. These are the specifications:
|
| 28 |
+
- If something needs to be generated, it should be inside a Generator block. These are defined by being enclosed in double curly braces.
|
| 29 |
+
- inside the double curly braces, we have a reference name for the block, followed by a pipe, and then a short description of the tone, then the structure, and then instructions. Like this:
|
| 30 |
+
- {{{{ product_feature | upbeat, 3rd person, rythmic. paragraph, 40-60 words. make sure to mention the brand name }}}}
|
| 31 |
+
- If we need a control structure (loop, conditional) we wrap these in single curly braces with percentage signs. These should not be written out, but if there is a generator inside, that will be used. some examples:
|
| 32 |
+
{{% if the product has a pattern %}}
|
| 33 |
+
{{{{ pattern_desciption | direct, monotone. 2 short sentences. Describe the pattern}}}}
|
| 34 |
+
{{% end if %}}
|
| 35 |
|
| 36 |
+
{{% for top 5 features of the product %}}
|
| 37 |
+
{{{{ feature_bullet | aspirational, humorous. A title for the feature, followed by a single sentence about the feature}}}}
|
| 38 |
+
{{% end %}}
|
| 39 |
+
|
| 40 |
**Reference Copy:**
|
| 41 |
{combined_references}
|
| 42 |
|
|
|
|
| 45 |
|
| 46 |
# Call the OpenAI API using the new ChatCompletion interface
|
| 47 |
response = openai.ChatCompletion.create(
|
| 48 |
+
model="o3-mini", # or your preferred model
|
| 49 |
messages=[
|
| 50 |
{"role": "system", "content": "You are a helpful assistant that generates structured e-commerce copywriting templates."},
|
| 51 |
{"role": "user", "content": prompt}
|