Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e18b3b2
chore: ensure and fields on relevant blocks; block renaming
mmikita95 Apr 9, 2025
e5e41df
fix: bring back default model
mmikita95 Apr 9, 2025
3519cf2
fix: lint
mmikita95 Apr 9, 2025
53a6d40
fix: remove redundant import
mmikita95 Apr 9, 2025
a56aa54
chore: session context for block execution
mmikita95 Apr 10, 2025
142b099
fix: none safety for headers
mmikita95 Apr 10, 2025
162a933
chore: rely on `get_session`; autogen
mmikita95 Apr 10, 2025
46b928d
chore: title case to lower case
mmikita95 Apr 10, 2025
108a629
fix: update desc fro "UI trigger" default result field
madeindjs Apr 10, 2025
d080dab
fix(ui): handle empty description in "Component field"
madeindjs Apr 10, 2025
212812a
fix: update desc for "UI trigger" default result field
madeindjs Apr 10, 2025
1f8eb62
Merge pull request #822 from writer/minor-fix-bluprint
madeindjs Apr 10, 2025
aee90d3
Merge pull request #814 from mmikita95/chore-block-params-names
ramedina86 Apr 10, 2025
b5071a9
fix: Remove initializeFormValueBroker
ramedina86 Apr 10, 2025
ebc3fe1
chore: Bump version
ramedina86 Apr 10, 2025
9f93c36
chore: Remove unused app templates
ramedina86 Apr 10, 2025
20a5778
Merge pull request #819 from mmikita95/chore-session-context
ramedina86 Apr 10, 2025
801dbdd
chore: New default and hello
ramedina86 Apr 10, 2025
17ea54b
chore: Delete default and hello
ramedina86 Apr 10, 2025
65d811b
chore: Default and hello templates
ramedina86 Apr 10, 2025
c37da26
Merge pull request #823 from writer/chore-template-cleanup
ramedina86 Apr 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/doc-notify.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/docs.yml

This file was deleted.

1 change: 0 additions & 1 deletion apps/ai-starter/.wf/components-blueprints_root.jsonl

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion apps/ai-starter/.wf/components-root.jsonl

This file was deleted.

3 changes: 0 additions & 3 deletions apps/ai-starter/.wf/metadata.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/ai-starter/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions apps/ai-starter/main.py

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ai-starter/static/README.md

This file was deleted.

Binary file removed apps/ai-starter/static/favicon.png
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{"id": "t84xyhxau9ej3823", "type": "blueprints_blueprint", "content": {"key": "button@click_1"}, "handlers": {}, "isCodeManaged": false, "parentId": "blueprints_root", "position": 0}
{"id": "ajz7x4j5a8hxs2bv", "type": "blueprints_uieventtrigger", "content": {"alias": "Draft response clicked", "refComponentId": "zazp9q0cpsglynsb", "refEventType": "wf-click"}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "93g3eyjmg2fg70qp", "outId": "trigger"}], "parentId": "t84xyhxau9ej3823", "position": 0, "x": 64, "y": 506}
{"id": "45o08yveht7ik3yy", "type": "blueprints_writerclassification", "content": {"alias": "Classify review category", "categories": "{\n \"Packaging\": \"The review mentions packaging issues or compliments.\",\n \"Pricing\": \"The review discusses pricing concerns or satisfaction.\",\n \"Quality\": \"The review is about the quality of the product or service.\",\n \"Delivery\": \"The review relates to delivery times or issues.\",\n \"Empty\": \"A review is mentioned but the review cannot be found\"\n}", "text": "The review ---- @{customer_review}"}, "handlers": {}, "isCodeManaged": false, "outs": [{"outId": "category_Packaging", "toNodeId": "dtuo9bh3p7toty0j"}, {"outId": "category_Pricing", "toNodeId": "mrpyadopzfli2h79"}, {"outId": "category_Delivery", "toNodeId": "n4elvd6x9dv5m7gb"}, {"toNodeId": "ivjmqw1niyhfthdr", "outId": "category_Quality"}, {"toNodeId": "ulqo7gkb31d71y5x", "outId": "category_Empty"}], "parentId": "t84xyhxau9ej3823", "position": 1, "x": 800, "y": 389}
{"id": "dtuo9bh3p7toty0j", "type": "blueprints_writercompletion", "content": {"alias": "Draft packaging response", "modelId": "palmyra-x-004", "prompt": "Take the role of a customer success rep and draft a response to the customer review below that metnions packaging: @{customer_review}\n\nThe response should be short, positive and helpful in style."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "btou78lp2y6p71nv", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 2, "x": 1168, "y": 64}
{"id": "mrpyadopzfli2h79", "type": "blueprints_writercompletion", "content": {"alias": "Draft pricing response", "modelId": "palmyra-x-004", "prompt": "Take the role of a customer success rep and draft a response to the customer review below that metnions pricing: @{customer_review}\n\nThe response should be short, positive and helpful in style."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "2zweloyuigct4dc1", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 3, "x": 1168, "y": 282}
{"id": "ivjmqw1niyhfthdr", "type": "blueprints_writercompletion", "content": {"alias": "Draft quality response", "modelId": "palmyra-x-004", "prompt": "Take the role of a customer success rep and draft a response to the customer review below that metnions quality: @{customer_review}\n\nThe response should be short, positive and helpful in style."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "n95sdks0gfo1i22x", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 4, "x": 1168, "y": 481}
{"id": "n4elvd6x9dv5m7gb", "type": "blueprints_writercompletion", "content": {"alias": "Draft delivery response", "modelId": "palmyra-x-004", "prompt": "Take the role of a customer success rep and draft a response to the customer review below that metnions delivery: @{customer_review}\n\nThe response should be short, positive and helpful in style."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "uihu1riz55hxbje6", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 5, "x": 1168, "y": 680}
{"id": "n95sdks0gfo1i22x", "type": "blueprints_setstate", "content": {"alias": "Store response", "element": "review_response", "value": "@{result}"}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "csz5m0gkb3gis9ub", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 6, "x": 1536, "y": 462}
{"id": "2zweloyuigct4dc1", "type": "blueprints_setstate", "content": {"alias": "Store response", "element": "review_response", "value": "@{result}"}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "mos6gff8lo7f8rx0", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 7, "x": 1536, "y": 263}
{"id": "btou78lp2y6p71nv", "type": "blueprints_setstate", "content": {"alias": "Store response", "element": "review_response", "value": "@{result}"}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "rvruozvwzqwwmnws", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 8, "x": 1536, "y": 64}
{"id": "uihu1riz55hxbje6", "type": "blueprints_setstate", "content": {"alias": "Store response", "element": "review_response", "value": "@{result}"}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "pmus4a0919giu1hs", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 9, "x": 1536, "y": 661}
{"id": "93g3eyjmg2fg70qp", "type": "blueprints_setstate", "content": {"alias": "Set progress message", "element": "progress_message", "value": "% Reviewing..."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "45o08yveht7ik3yy", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 10, "x": 431, "y": 472}
{"id": "rvruozvwzqwwmnws", "type": "blueprints_setstate", "content": {"alias": "Clear progress message", "element": "progress_message"}, "handlers": {}, "isCodeManaged": false, "parentId": "t84xyhxau9ej3823", "position": 11, "x": 1904, "y": 134}
{"id": "mos6gff8lo7f8rx0", "type": "blueprints_setstate", "content": {"alias": "Clear progress message", "element": "progress_message"}, "handlers": {}, "isCodeManaged": false, "parentId": "t84xyhxau9ej3823", "position": 12, "x": 1904, "y": 352}
{"id": "csz5m0gkb3gis9ub", "type": "blueprints_setstate", "content": {"alias": "Clear progress message", "element": "progress_message"}, "handlers": {}, "isCodeManaged": false, "parentId": "t84xyhxau9ej3823", "position": 13, "x": 1904, "y": 571}
{"id": "pmus4a0919giu1hs", "type": "blueprints_setstate", "content": {"alias": "Clear progress message", "element": "progress_message"}, "handlers": {}, "isCodeManaged": false, "parentId": "t84xyhxau9ej3823", "position": 14, "x": 1904, "y": 790}
{"id": "ulqo7gkb31d71y5x", "type": "blueprints_setstate", "content": {"alias": "Handle empty review", "element": "review_response", "value": "You must specify a review."}, "handlers": {}, "isCodeManaged": false, "outs": [{"toNodeId": "69q6jc5p6ue4nr8q", "outId": "success"}], "parentId": "t84xyhxau9ej3823", "position": 15, "x": 1168, "y": 880}
{"id": "69q6jc5p6ue4nr8q", "type": "blueprints_setstate", "content": {"alias": "Clear progress message", "element": "progress_message"}, "handlers": {}, "isCodeManaged": false, "parentId": "t84xyhxau9ej3823", "position": 16, "x": 1536, "y": 860}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{"id": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "type": "page", "content": {"pageMode": "compact"}, "handlers": {}, "isCodeManaged": false, "parentId": "root", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "bebc5fe9-63a7-46a7-b0fa-62303555cfaf", "type": "header", "content": {"text": "@{my_app.title}"}, "handlers": {}, "isCodeManaged": false, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "28d3885b-0fb8-4d41-97c6-978540015431", "type": "section", "content": {"containerShadow": "0px 4px 11px -12px #000000", "title": ""}, "handlers": {}, "isCodeManaged": false, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 1, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "d4a5e62c-c6fe-49c4-80d4-33862af8727d", "type": "columns", "content": {}, "handlers": {}, "isCodeManaged": false, "parentId": "28d3885b-0fb8-4d41-97c6-978540015431", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "c2519671-9ce7-44e7-ba4e-b0efda9cb20e", "type": "column", "content": {"width": "1"}, "handlers": {}, "isCodeManaged": false, "parentId": "d4a5e62c-c6fe-49c4-80d4-33862af8727d", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "172a14df-f73a-44fa-8fb1-e8648e7d32d2", "type": "metric", "content": {"metricValue": "@{counter}", "name": "Counter", "note": "@{message}"}, "handlers": {}, "isCodeManaged": false, "parentId": "c2519671-9ce7-44e7-ba4e-b0efda9cb20e", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "d4a71819-7444-4083-a1c7-7995452a7abf", "type": "separator", "content": {}, "handlers": {}, "isCodeManaged": false, "parentId": "d4a5e62c-c6fe-49c4-80d4-33862af8727d", "position": 1, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "f3777e75-3659-4d44-8ef7-aeec0d06855b", "type": "column", "content": {"contentHAlign": "center", "contentVAlign": "center", "title": "", "width": "1"}, "handlers": {}, "isCodeManaged": false, "parentId": "d4a5e62c-c6fe-49c4-80d4-33862af8727d", "position": 2, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "0d05bc9f-1655-4d0b-bc9b-c2f4c71a5117", "type": "horizontalstack", "content": {"contentHAlign": "center"}, "handlers": {}, "isCodeManaged": false, "parentId": "f3777e75-3659-4d44-8ef7-aeec0d06855b", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "51d1554e-1b88-461c-9353-1419cba0053a", "type": "button", "content": {"icon": "arrow_downward", "text": "Decrement"}, "handlers": {"click": "decrement"}, "isCodeManaged": false, "parentId": "0d05bc9f-1655-4d0b-bc9b-c2f4c71a5117", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "9556c0e3-8584-4ac9-903f-908a775a33ec", "type": "button", "content": {"icon": "arrow_upward", "text": " Increment"}, "handlers": {"click": "increment"}, "isCodeManaged": false, "parentId": "0d05bc9f-1655-4d0b-bc9b-c2f4c71a5117", "position": 1, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "vwrfbi2qot5clwzy", "type": "image", "content": {"caption": "", "src": "static/welcome.svg?3"}, "handlers": {}, "isCodeManaged": false, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 0}
{"id": "29qur7xljy4faoqt", "type": "section", "content": {"title": "Example customer review responder"}, "handlers": {}, "isCodeManaged": false, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 1}
{"id": "fkxnuw7eitb422j6", "type": "text", "content": {"text": "See how a customer review can be categorized and used to generate a personalized response.\nCopy the sample review below, paste it in the customer review text box, and click draft response to see it in action."}, "handlers": {}, "isCodeManaged": false, "parentId": "29qur7xljy4faoqt", "position": 0}
{"id": "jk7fvn9aek99d5hs", "type": "section", "content": {"containerBackgroundColor": "#D4FFF2", "containerShadow": "none", "separatorColor": "none", "title": ""}, "handlers": {}, "isCodeManaged": false, "parentId": "29qur7xljy4faoqt", "position": 1}
{"id": "el6v2mozugelu9mw", "type": "text", "content": {"text": "**1. Copy me**\n\n\u201cI\u2019ve been searching for the perfect tailored blazer for years and I think I\u2019ve finally found it. The cut is precise without feeling restrictive. the material is rich and smooth\u201d", "useMarkdown": "yes"}, "handlers": {}, "isCodeManaged": false, "parentId": "jk7fvn9aek99d5hs", "position": 0}
{"id": "po6m73qliiv7g2ep", "type": "textareainput", "binding": {"eventType": "wf-change", "stateRef": "customer_review"}, "content": {"label": "2. Paste the example customer review above", "rows": "5"}, "handlers": {}, "isCodeManaged": false, "parentId": "29qur7xljy4faoqt", "position": 2}
{"id": "zazp9q0cpsglynsb", "type": "button", "content": {"text": "3. Generate response"}, "handlers": {}, "isCodeManaged": false, "parentId": "29qur7xljy4faoqt", "position": 3}
{"id": "k9fn5wf1kqwxvugj", "type": "section", "content": {"title": "Response message"}, "handlers": {}, "isCodeManaged": false, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 2, "visible": {"binding": "", "expression": "custom", "reversed": false}}
{"id": "khbe69j233n3d9ot", "type": "message", "content": {"message": "@{progress_message}"}, "handlers": {}, "isCodeManaged": false, "parentId": "k9fn5wf1kqwxvugj", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "z2noh2qiejykjjlq", "type": "section", "content": {"containerBackgroundColor": "#F5F5F9", "containerShadow": "none", "separatorColor": "none", "title": ""}, "handlers": {}, "isCodeManaged": false, "parentId": "k9fn5wf1kqwxvugj", "position": 1, "visible": {"binding": "review_response", "expression": "custom", "reversed": false}}
{"id": "sbzcwvq5e0z386cq", "type": "text", "content": {"text": "@{review_response}", "useMarkdown": "yes"}, "handlers": {}, "isCodeManaged": false, "parentId": "z2noh2qiejykjjlq", "position": 0, "visible": {"binding": "", "expression": "custom", "reversed": false}}
{"id": "coz1oojtyzs0slm0", "type": "section", "content": {"containerBackgroundColor": "#F5F5F9", "containerShadow": "none", "separatorColor": "none", "title": ""}, "handlers": {}, "isCodeManaged": false, "parentId": "k9fn5wf1kqwxvugj", "position": 2, "visible": {"binding": "review_response", "expression": "custom", "reversed": true}}
{"id": "akkcjdnrtudjd704", "type": "text", "content": {"text": "The response will be shown here.", "useMarkdown": "yes"}, "handlers": {}, "isCodeManaged": false, "parentId": "coz1oojtyzs0slm0", "position": 0, "visible": {"binding": "", "expression": true, "reversed": false}}
{"id": "nbr03edevbgnhi29", "type": "text", "content": {"alignment": "center", "primaryTextColor": "#828282", "text": "This is just an example agent - edit or delete it to start experimenting."}, "handlers": {}, "parentId": "c0f99a9e-5004-4e75-a6c6-36f17490b134", "position": 3}
2 changes: 1 addition & 1 deletion apps/default/.wf/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"writer_version": "0.8.1"
"writer_version": "0.8.3rc12"
}
3 changes: 0 additions & 3 deletions apps/default/README.md

This file was deleted.

41 changes: 7 additions & 34 deletions apps/default/main.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
import writer as wf

# This is a placeholder to get you started or refresh your memory.
# Delete it or adapt it as necessary.
# Documentation is available at https://dev.writer.com/framework

# Shows in the log when the app starts
print("Hello world!")

# Its name starts with _, so this function won't be exposed
def _update_message(state):
is_even = state["counter"] % 2 == 0
message = ("+Even" if is_even else "-Odd")
state["message"] = message

def decrement(state):
state["counter"] -= 1
_update_message(state)
# print("Hello world!")

def increment(state):
state["counter"] += 1
# Shows in the log when the event handler is run
print("The counter has been incremented.")
_update_message(state)

# Initialize the state

# "_my_private_element" won't be serialized or sent to the frontend,
# because it starts with an underscore
# You can define functions which can be called from Python code blocks
def my_func():
return 1

# You can initialize state via code
initial_state = wf.init_state({
"my_app": {
"title": "My app"
},
"_my_private_element": 1337,
"message": None,
"counter": 26,
})

_update_message(initial_state)
"my_var": 1337,
})
Loading