forked from writer/writer-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'streamsync-cloud:dev' into dev
- Loading branch information
Showing
36 changed files
with
661 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This app was created using Writer Framework. | ||
|
||
To learn more about it, visit https://developer.writer.com/framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import writer as wf | ||
import writer.ai | ||
|
||
# Welcome to Writer Framework! | ||
# This template is a starting point for your AI apps. | ||
# More documentation is available at https://developer.writer.com/framework | ||
|
||
|
||
# Initialise the state | ||
wf.init_state({ | ||
"my_app": { | ||
"title": "AI STARTER" | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tool.poetry] | ||
name = "writer-framework-default" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10.0" | ||
writer = {version = "^0.6.0"} | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Serving static files | ||
|
||
You can use this folder to store files which will be served statically in the "/static" route. | ||
|
||
This is useful to store images and other files which will be served directly to the user of your application. | ||
|
||
For example, if you store an image named "myimage.jpg" in this folder, it'll be accessible as "static/myimage.jpg". | ||
You can use this relative route as the source in an Image component. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"metadata": { | ||
"writer_version": "0.6.0rc3" | ||
}, | ||
"components": { | ||
"root": { | ||
"id": "root", | ||
"type": "root", | ||
"content": { | ||
"appName": "AI Starter" | ||
}, | ||
"isCodeManaged": false, | ||
"position": 0, | ||
"handlers": {}, | ||
"visible": true | ||
}, | ||
"c0f99a9e-5004-4e75-a6c6-36f17490b134": { | ||
"id": "c0f99a9e-5004-4e75-a6c6-36f17490b134", | ||
"type": "page", | ||
"content": { | ||
"pageMode": "compact" | ||
}, | ||
"isCodeManaged": false, | ||
"position": 0, | ||
"parentId": "root", | ||
"handlers": {}, | ||
"visible": true | ||
}, | ||
"bebc5fe9-63a7-46a7-b0fa-62303555cfaf": { | ||
"id": "bebc5fe9-63a7-46a7-b0fa-62303555cfaf", | ||
"type": "header", | ||
"content": { | ||
"text": "@{my_app.title}" | ||
}, | ||
"isCodeManaged": false, | ||
"position": 0, | ||
"parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", | ||
"handlers": {}, | ||
"visible": true | ||
}, | ||
"ejpasds0o8qyjs1n": { | ||
"id": "ejpasds0o8qyjs1n", | ||
"type": "section", | ||
"content": { | ||
"title": "Section Title" | ||
}, | ||
"isCodeManaged": false, | ||
"position": 1, | ||
"parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", | ||
"handlers": {}, | ||
"visible": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
# Writer Framework app | ||
|
||
## Editing the project | ||
|
||
```bash | ||
poetry install | ||
poetry run writer edit . | ||
``` | ||
|
||
## Running the project | ||
|
||
```bash | ||
poetry run writer run . | ||
``` | ||
|
||
## Deploying the project | ||
|
||
```bash | ||
poetry run writer deploy . | ||
``` | ||
This app was created using Writer Framework. | ||
|
||
To learn more about it, visit https://developer.writer.com/framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
# Writer Framework app | ||
|
||
## Editing the project | ||
|
||
```bash | ||
poetry install | ||
poetry run writer edit . | ||
``` | ||
|
||
## Running the project | ||
|
||
```bash | ||
poetry run writer run . | ||
``` | ||
|
||
## Deploying the project | ||
|
||
```bash | ||
poetry run writer deploy . | ||
``` | ||
This app was created using Writer Framework. | ||
|
||
To learn more about it, visit https://developer.writer.com/framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This app was created using Writer Framework. | ||
|
||
To learn more about it, visit https://developer.writer.com/framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import writer as wf | ||
import writer.ai | ||
from prompts import base_prompts, seo_keywords, user_prompt | ||
|
||
# This is the base template for the Product Description Generator tutorial. | ||
# More documentation is available at https://developer.writer.com/framework | ||
|
||
# Initialize state here | ||
wf.init_state({ | ||
"form": { | ||
"title": "", | ||
"description": "", | ||
"keywords": "" | ||
}, | ||
"message": "Fill in the inputs and click \"Generate\" to get started.", | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# BASE PROMPTS (TAILORED TO EACH COMPANY) | ||
|
||
base_prompts = {} | ||
|
||
base_prompts["Testco"] = """ | ||
System Instruction: Create enticing product description pages for Saturn Snacking products to be featured on the Testco supermarket website in the UK. Utilize the provided data fields to ensure each description is comprehensive and tailored to the Saturn Snacking brand. The aim is to make these product offerings more attractive to customers, thereby increasing purchases. | ||
Prompt Details: Use the provided input data: | ||
{title} | ||
{description} | ||
to generate detailed and enticing product descriptions. | ||
""" | ||
|
||
base_prompts["SuperEats"] = """ | ||
System Instruction: Create enticing product description pages for Saturn Snacking products to be featured on the Super Eats platform, which is an online platform usually accessed via mobile phones. Utilize the provided data fields to ensure each description is comprehensive and tailored to the Saturn Snacking brand. The aim is to make these product offerings more attractive to customers, thereby increasing purchases. | ||
The description should be engaging, informative, and limited to a maximum of three sentences. This brief format should be suitable for customers browsing on the Super Eats platform, providing them with enough information to make an informed choice quickly. | ||
Prompt Details: Use the provided input data: | ||
{title} | ||
{description} | ||
to generate one compact and enticing product description. | ||
""" | ||
|
||
base_prompts["Midl"] = """ | ||
System Instruction: Create enticing product description pages for Saturn Snacking products to be featured on the Midl discount supermarket from Germany. Utilize the provided data fields to ensure each description is comprehensive and tailored to the Saturn Snacking brand. The aim is to make these product offerings more attractive to customers, thereby increasing purchases. | ||
Prompt Details: Use the provided input data: | ||
{title} | ||
{description} | ||
to generate compact and enticing product descriptions. | ||
""" | ||
|
||
### SEO KEYWORD PROMPT | ||
seo_keywords = """ | ||
System Instruction: Analyze a group of product descriptions and identify the SEO keywords that are most frequently used. This analysis will help in understanding the common themes and keywords that are essential for optimizing the product descriptions for search engines. | ||
Prompt Details: Examine the following product descriptions and identify the SEO keywords that are most frequently used. | ||
{descriptions} | ||
Provide Plotly.js graph specification that includes a JSON dictionary of the top 10 keywords and the number of times they appear in the descriptions. The graph should be visually appealing and easy to interpret, highlighting the most relevant keywords. Use #5551ff as the color for the bars in the graph. | ||
""" | ||
|
||
# USER PROMPT TEMPLATE | ||
user_prompt = """ | ||
System Instruction: Create enticing product description pages for Saturn Snacking products to be featured on the {name} supermarket website. Utilize the provided data fields to ensure each description is comprehensive and tailored to the Saturn Snacking brand. The aim is to make these product offerings more attractive to customers, thereby increasing purchases. | ||
Prompt Details: Use the provided input data: | ||
{title} | ||
{description} | ||
to generate detailed and enticing product descriptions. Ensure the description is no longer than {character_max} characters. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tool.poetry] | ||
name = "writer-framework-default" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10.0" | ||
writer = {version = "^0.6.0"} | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Serving static files | ||
|
||
You can use this folder to store files which will be served statically in the "/static" route. | ||
|
||
This is useful to store images and other files which will be served directly to the user of your application. | ||
|
||
For example, if you store an image named "myimage.jpg" in this folder, it'll be accessible as "static/myimage.jpg". | ||
You can use this relative route as the source in an Image component. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.