app: description: ☝️ You can input a ‘Word’, and the Wordplay Bot will generate a beautifully crafted philosophical interpretation card for you. icon: ☀️ icon_background: '#FFE4E8' mode: advanced-chat name: Wordplay use_icon_as_answer_icon: false kind: app version: 0.1.2 workflow: conversation_variables: [] environment_variables: [] features: file_upload: image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url opening_statement: '' retriever_resource: enabled: false sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: sourceType: start targetType: llm id: 1726099945853-llm source: '1726099945853' sourceHandle: source target: llm targetHandle: target type: custom - data: isInIteration: false sourceType: llm targetType: code id: llm-source-1726107763753-target source: llm sourceHandle: source target: '1726107763753' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: code targetType: answer id: 1726107763753-source-answer-target source: '1726107763753' sourceHandle: source target: answer targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: Start type: start variables: [] height: 54 id: '1726099945853' position: x: 80 y: 282 positionAbsolute: x: 80 y: 282 sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: false variable_selector: [] desc: '' memory: query_prompt_template: "{{#sys.query#}}\n(Generate the complete SVG code\ \ directly, I will copy it, please use a code block)\n(Do not provide\ \ any additional explanations besides this)\n(Please don’t use overly\ \ long text, but keep it concise instead.)\n(There needs to be a significant\ \ distance between the geometric shapes in the middle and the body text,\ \ preserving negative space.)\n\nThe maximum width of the text should\ \ match the line above.\nAutomatically add line break tags to the content\ \ of the explanation, for example:\n Text1,\n Text2," role_prefix: assistant: '' user: '' window: enabled: false size: 10 model: completion_params: temperature: 0.7 mode: chat name: claude-3-5-sonnet-20240620 provider: anthropic prompt_template: - id: cd16d16b-62b2-452d-91fd-a091312787a5 role: system text: '{start ;; Author: Li Jigang / Translated by Lyson Ober (English / Japanese Version) ;; Version: 0.4 ;; Model: Claude Sonnet ;; Purpose: Provide a metaphorical perspective on interpreting English vocabulary ;; Set the following content as your *System Prompt* (defun new-English-vocabulary-teacher () "You''re a thoughtful observer, deep thinker, eloquent in language" (style . ("Jorge Luis Borges" "Italo Calvino" "Haruki Murakami")) (speciality . insightful-metaphors) (expression . metaphorical) (interpretation . thought-provoking)) (defun wordplay (user-input) "You''ll interpret a word from a metaphorical perspective" (let (interpretation (concise-expression (metaphor (insightful-metaphors (thought-provoking (capture-essence user-input)))))) (few-shots (metaphor . "Words are bridges spanning the chasms between minds.")) (SVG-Card interpretation))) (defun SVG-Card (interpretation) "Output SVG card" (setq design-rule "Use subtle imagery and thoughtful layout, overall design should evoke contemplation" design-principles ''(elegant subtle thought-provoking)) (set-canvas ''(width 400 height 600 margin 20)) (title-font ''brush-script-kaiti) (auto-scale ''(minimum-font-size 16)) (color-scheme ''((background-color (zen-garden-palette design-aesthetic))) (main-text (huiwen-mincho-font ink-black)) (decorative-pattern abstract-natural-forms)) (card-elements ((centered-title "Word Reflection") divider-line (layout-output user-input english japanese) interpretation (line-drawing (metaphorical-core interpretation)) (contemplative-summary line-drawing)))) (defun start () "Run at startup" (let (system-role new-English-vocabulary-teacher) (print "What word shall we explore through the lens of metaphor today?"))) ;; Running Rules ;; 1. Must run (start) function at startup ;; 2. Then call main function (wordplay user-input) end }' - id: 749128f5-e95a-480c-9d7b-aeb9982cb9e3 role: user text: Start - id: bdae2ae8-856b-4e9a-ab73-8fc780b0091f role: assistant text: What word shall we explore through the lens of metaphor today? selected: false title: Wordplay type: llm variables: [] vision: configs: detail: high enabled: true height: 98 id: llm position: x: 379.42289407176384 y: 282 positionAbsolute: x: 379.42289407176384 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: answer: 'SVG: {{#llm.text#}} HTML: ![]({{#1726107763753.result#}})' desc: '' selected: false title: SVG Code type: answer variables: [] height: 125 id: answer position: x: 980.8434756579409 y: 282 positionAbsolute: x: 980.8434756579409 y: 282 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: author: lysonober desc: '' height: 186 selected: false showAuthor: true text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lyson Ober''s tip:","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"After the SVG code generation is complete, go here to render and share with one click! 👉 https://www.svgviewer.dev/","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"But now, we can render directly!","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Look this note 👉 ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}' theme: blue title: '' type: '' width: 253 height: 186 id: '1726101164710' position: x: 384.95249966643075 y: 403.93735921409603 positionAbsolute: x: 384.95249966643075 y: 403.93735921409603 selected: false sourcePosition: right targetPosition: left type: custom-note width: 253 - data: author: lysonober desc: '' height: 286 selected: false showAuthor: true text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"👋 Hi everyone, I''m ","type":"text","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lyson Ober","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":"noreferrer","target":null,"title":null,"url":"https://x.com/lyson_ober"},{"detail":0,"format":0,"mode":"normal","style":"","text":". This is my Dify implementation DSL file for the prompt from ","type":"text","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Li Jigang","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":"noreferrer","target":null,"title":null,"url":"https://m.okjike.com/users/752D3103-1107-43A0-BA49-20EC29D09E36"},{"detail":0,"format":0,"mode":"normal","style":"","text":". ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"👉 Check it out ","type":"text","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"here","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":"noreferrer","target":null,"title":null,"url":"https://dify101.com/tutorial/hanyuxinjie"}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"✨ I hope this can help you learn Dify, and also serve as a supplement to Li Jigang''s generous sharing.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"🙏 Thank you all for your wisdom and contributions. It''s because you open-source contributors have made Dify better. Your efforts are greatly appreciated!","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}' theme: blue title: '' type: '' width: 241 height: 286 id: '1726101257454' position: x: 82.95491644963508 y: 366.95134777626964 positionAbsolute: x: 82.95491644963508 y: 366.95134777626964 selected: false sourcePosition: right targetPosition: left type: custom-note width: 241 - data: code: "import base64\n\n\ndef main(svg_str: str) -> dict:\n svg_str = svg_str.strip(\"\ ```svg\\n\")\n svg_bytes = svg_str.encode(\"utf-8\")\n base64_bytes\ \ = base64.b64encode(svg_bytes)\n base64_string = base64_bytes.decode(\"\ utf-8\")\n result = f\"data:image/svg+xml;base64,{base64_string}\"\n\ \ return {\n \"result\": result,\n }\n" code_language: python3 desc: '' outputs: result: children: null type: string selected: false title: svg-to-base64 type: code variables: - value_selector: - llm - text variable: svg_str height: 54 id: '1726107763753' position: x: 680 y: 282 positionAbsolute: x: 680 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: author: lysonober desc: '' height: 116 selected: false showAuthor: true text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"From Rain''s tip:","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1,"textFormat":0},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Like this 👆","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}' theme: pink title: '' type: '' width: 246 height: 116 id: '1726130016426' position: x: 680 y: 408.14031505930365 positionAbsolute: x: 680 y: 408.14031505930365 selected: false sourcePosition: right targetPosition: left type: custom-note width: 246 viewport: x: -11.895080706024373 y: -14.005980087521351 zoom: 1.0673601188764852