{"id":75291,"date":"2026-02-11T22:26:09","date_gmt":"2026-02-11T14:26:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/75291.html"},"modified":"2026-02-11T22:26:09","modified_gmt":"2026-02-11T14:26:09","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8langgraph4j%e5%b7%a5%e4%bd%9c%e6%b5%81%e6%94%b9%e9%80%a0%e9%a1%b9%e7%9b%ae%e6%b5%81%e7%a8%8b%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/75291.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5"},"content":{"rendered":"<h2 id=\"owLX5\">\u9879\u76ee\u8fdb\u884cAI\u5de5\u4f5c\u6d41\u6539\u9020<\/h2>\n<h3 id=\"u9U48\" style=\"background-color:transparent\">Demo\u6f14\u793a<\/h3>\n<p id=\"u6dac6e39\">\u5f15\u5165\u4f9d\u8d56&#xff1a;<\/p>\n<p>&lt;!&#8211; LangGraph4j &#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n  &lt;groupId&gt;org.bsc.langgraph4j&lt;\/groupId&gt;<br \/>\n  &lt;artifactId&gt;langgraph4j-core&lt;\/artifactId&gt;<br \/>\n  &lt;version&gt;1.6.0-rc2&lt;\/version&gt;<br \/>\n&lt;\/dependency&gt; <\/p>\n<p id=\"ueedab9fc\">\u53c2\u8003\u5b98\u65b9\u6587\u6863&#xff0c;\u7f16\u5199LangGraph4j\u7684demo&#xff0c;\u53ef\u4ee5\u770b\u770b\u5de5\u4f5c\u6d41\u7684\u5927\u6982\u8981\u5b9e\u73b0\u7684\u5185\u5bb9&#xff1a;<\/p>\n<p id=\"uea1ffea3\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"154\" id=\"u806f1e1c\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142605-698c917dde2b8.png\" width=\"430\" \/><\/p>\n<p id=\"u9d6c38af\">1.\u5b9a\u4e49\u72b6\u6001&#xff1a;<\/p>\n<p>\/\/ Define the state for our graph<br \/>\nclass SimpleState extends AgentState {<br \/>\n    public static final String MESSAGES_KEY &#061; &#034;messages&#034;;<\/p>\n<p>    \/\/ Define the schema for the state.<br \/>\n    \/\/ MESSAGES_KEY will hold a list of strings, and new messages will be appended.<br \/>\n    public static final Map&lt;String, Channel&lt;?&gt;&gt; SCHEMA &#061; Map.of(<br \/>\n        MESSAGES_KEY, Channels.appender(ArrayList::new)<br \/>\n    );<\/p>\n<p>    public SimpleState(Map&lt;String, Object&gt; initData) {<br \/>\n        super(initData);<br \/>\n    }<\/p>\n<p>    public List&lt;String&gt; messages() {<br \/>\n        return this.&lt;List&lt;String&gt;&gt;value(&#034;messages&#034;)<br \/>\n        .orElse( List.of() );<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u7b6b860b\">2.\u5b9a\u4e49\u8bf7\u6c42\u8282\u70b9\u548c\u54cd\u5e94\u8282\u70b9&#xff1a;<\/p>\n<p>\/\/ Node that adds a greeting<br \/>\nclass GreeterNode implements NodeAction&lt;SimpleState&gt; {<br \/>\n    &#064;Override<br \/>\n    public Map&lt;String, Object&gt; apply(SimpleState state) {<br \/>\n        System.out.println(&#034;GreeterNode executing. Current messages: &#034; &#043; state.messages());<br \/>\n        return Map.of(SimpleState.MESSAGES_KEY, &#034;Hello from GreeterNode!&#034;);<br \/>\n    }<br \/>\n}<br \/>\n\/\/ Node that adds a response<br \/>\nclass ResponderNode implements NodeAction&lt;SimpleState&gt; {<br \/>\n    &#064;Override<br \/>\n    public Map&lt;String, Object&gt; apply(SimpleState state) {<br \/>\n        System.out.println(&#034;ResponderNode executing. Current messages: &#034; &#043; state.messages());<br \/>\n        List&lt;String&gt; currentMessages &#061; state.messages();<br \/>\n        if (currentMessages.contains(&#034;Hello from GreeterNode!&#034;)) {<br \/>\n            return Map.of(SimpleState.MESSAGES_KEY, &#034;Acknowledged greeting!&#034;);<br \/>\n        }<br \/>\n        return Map.of(SimpleState.MESSAGES_KEY, &#034;No greeting found.&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u2cd24f75\">3.\u6700\u540e\u5b9a\u4e49\u5de5\u4f5c\u6d41\u7ed3\u6784&#xff1a;<\/p>\n<p>public class SimpleGraphApp {<\/p>\n<p>    public static void main(String[] args) throws GraphStateException {<br \/>\n        \/\/ Initialize nodes<br \/>\n        GreeterNode greeterNode &#061; new GreeterNode();<br \/>\n        ResponderNode responderNode &#061; new ResponderNode();<\/p>\n<p>        \/\/ Define the graph structure<br \/>\n        var stateGraph &#061; new StateGraph&lt;&gt;(SimpleState.SCHEMA, initData -&gt; new SimpleState(initData))<br \/>\n        .addNode(&#034;greeter&#034;, node_async(greeterNode))<br \/>\n        .addNode(&#034;responder&#034;, node_async(responderNode))<br \/>\n        \/\/ Define edges<br \/>\n        .addEdge(START, &#034;greeter&#034;) \/\/ Start with the greeter node<br \/>\n        .addEdge(&#034;greeter&#034;, &#034;responder&#034;)<br \/>\n        .addEdge(&#034;responder&#034;, END)   \/\/ End after the responder node<br \/>\n        ;<br \/>\n        \/\/ Compile the graph<br \/>\n        var compiledGraph &#061; stateGraph.compile();<\/p>\n<p>        \/\/ \u6253\u5370\u51fa\u5de5\u4f5c\u6d41\u53ef\u89c6\u5316\u7f16\u6392&#8212;\u6587\u672c\u7ed8\u56fe\u65b9\u6cd5\u80fd\u529b<br \/>\n        GraphRepresentation graph &#061; stateGraph.getGraph(GraphRepresentation.Type.MERMAID, &#034;demo&#034;);<br \/>\n        System.out.println(graph.toString());<\/p>\n<p>        \/\/ Run the graph<br \/>\n        \/\/ The &#096;stream&#096; method returns an AsyncGenerator.<br \/>\n        \/\/ For simplicity, we&#039;ll collect results. In a real app, you might process them as they arrive.<br \/>\n        \/\/ Here, the final state after execution is the item of interest.<\/p>\n<p>        for (var item : compiledGraph.stream( Map.of( SimpleState.MESSAGES_KEY, &#034;Let&#039;s, begin!&#034; ) ) ) {<\/p>\n<p>            System.out.println( item );<br \/>\n        }<\/p>\n<p>    }<br \/>\n} <\/p>\n<p id=\"u69740884\">\u6267\u884c\u67e5\u770b\u6548\u679c&#xff1a;<\/p>\n<p id=\"u7d7e314f\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"891\" id=\"ud7400a8e\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142606-698c917e04c3b.png\" width=\"986\" \/><\/p>\n<h3 id=\"a0Obv\" style=\"background-color:transparent\">\u5de5\u4f5c\u6d41\u5728\u9879\u76ee\u4e2d\u7684\u8fd0\u7528\u6539\u9020<\/h3>\n<p id=\"u61284a44\">\u9879\u76ee\u6539\u9020\u601d\u8def\u6d41\u7a0b&#xff1a;<\/p>\n<p id=\"u0cd0edfe\">\u4ee5AI\u751f\u6210\u4ee3\u7801\u7f51\u7ad9\u573a\u666f\u4e3a\u4f8b&#xff0c;<\/p>\n<p id=\"u2b5e86df\">\u7528\u6237\u8f93\u5165\u63d0\u793a\u8bcd -&gt; Agent\u901a\u8fc7\u5de5\u5177\u8c03\u7528\u4ece\u4e0d\u540c\u7684\u6e20\u9053\u83b7\u53d6\u56fe\u7247\u7d20\u6750 -&gt; \u5185\u5bb9\u56fe\u7247pexels\u7f51\u9875\u641c\u7d22 -&gt; \u63d2\u753b\u56fe\u7247undraw\u6293\u53d6 -&gt; \u6587\u672c\u7ed8\u56fe&#043;\u4e0a\u4f20\u5230COS -&gt; AI\u751f\u6210\u6216MCP\u670d\u52a1Logo\u7b49\u8bbe\u8ba1\u56fe\u7247 -&gt; \u63d0\u793a\u8bcd\u589e\u5f3a\u5173\u8054\u56fe\u7247\u5185\u5bb9\u5230\u539f\u59cb\u63d0\u793a\u8bcd -&gt; \u667a\u80fd\u8def\u7531Agent\u9009\u62e9\u6a21\u5f0f\u751f\u6210\u7f51\u7ad9&#xff08;\u539f\u751fHTML\u3001\u591a\u6587\u4ef6\u3001Vue\u5de5\u7a0b&#xff09; -&gt; \u5229\u7528\u641c\u7d22\u5230\u7684\u56fe\u7247\u548c\u6839\u636e\u4e0a\u4e00\u6b65\u786e\u8ba4\u7684\u6a21\u5f0f\u751f\u6210\u7f51\u7ad9 -&gt; \u6587\u4ef6\u4fdd\u5b58\u9879\u76ee\u6784\u5efa\u6253\u5305<\/p>\n<p id=\"u82dcd300\">\u5de5\u4f5c\u6d41\u5f00\u53d1\u6b65\u9aa4&#xff1a;<\/p>\n<p id=\"u49b68487\">\u5b9a\u4e49\u5de5\u4f5c\u6d41\u7ed3\u6784 -&gt; \u5b9a\u4e49\u72b6\u6001 -&gt; \u5b9a\u4e49\u5de5\u4f5c\u8282\u70b9&#xff08;\u5148\u901a\u8fc7\u5047\u6570\u636e\u8fdb\u884c\u6a21\u62df\u72b6\u6001\u6d41\u8f6c&#xff09;-&gt; \u5f00\u53d1\u771f\u5b9e\u7684\u5de5\u4f5c\u8282\u70b9 -&gt; \u5de5\u4f5c\u6d41\u4e2d\u4f7f\u7528\u8282\u70b9&#xff0c;\u63d0\u4f9b\u5b8c\u6574\u7684\u5de5\u4f5c\u6d41\u670d\u52a1<\/p>\n<p id=\"u24e0f812\">\u53ef\u4ee5\u4f7f\u7528AI\u751f\u6210\u5de5\u4f5c\u6d41\u7ed3\u6784&#xff0c;\u63d0\u793a\u8bcd\u5982\u4e0b&#xff1a;<\/p>\n<p>\u5e2e\u6211\u751f\u6210 LangGraph4j \u5de5\u4f5c\u6d41\u7684\u4ee3\u7801<\/p>\n<p>## \u5de5\u4f5c\u6d41\u7684\u6d41\u7a0b\u63cf\u8ff0<\/p>\n<p>\/\/ &#8230; \u8865\u5145\u5177\u4f53\u7684\u6d41\u7a0b<\/p>\n<p>## \u8981\u6c42<\/p>\n<p>\u5148\u751f\u6210\u57fa\u7840\u7684\u5de5\u4f5c\u6d41\u7ed3\u6784\u4ee3\u7801&#xff0c;\u6bcf\u4e2a\u5de5\u4f5c\u8282\u70b9\u4e2d\u53ea\u8f93\u51fa\u4e00\u53e5\u4fe1\u606f\u5c31\u591f\u4e86&#xff0c;\u4e0d\u7528\u771f\u6b63\u5b9e\u73b0\u5177\u4f53\u7684\u4e1a\u52a1\u903b\u8f91\u3002<\/p>\n<p>## \u53c2\u8003\u4fe1\u606f<\/p>\n<p>\u5b98\u65b9\u6587\u6863&#xff1a;&#064;https:\/\/langgraph4j.github.io\/langgraph4j\/core\/low_level\/<br \/>\n\u793a\u4f8b\u5de5\u4f5c\u6d41\u5b9e\u73b0&#xff1a;&#064;https:\/\/github.com\/langgraph4j\/langgraph4j-examples\/blob\/main\/langchain4j\/adaptive-rag\/src\/main\/java\/dev\/langchain4j\/adaptiverag\/AdaptiveRag.java<\/p>\n<h4 id=\"HgpFr\">\u5b9a\u4e49\u7b80\u5355\u5de5\u4f5c\u6d41\u56fe\u7ed3\u6784<\/h4>\n<p id=\"u386cfbd4\">\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>import lombok.extern.slf4j.Slf4j;<br \/>\nimport org.bsc.langgraph4j.CompiledGraph;<br \/>\nimport org.bsc.langgraph4j.GraphRepresentation;<br \/>\nimport org.bsc.langgraph4j.GraphStateException;<br \/>\nimport org.bsc.langgraph4j.NodeOutput;<br \/>\nimport org.bsc.langgraph4j.action.AsyncNodeAction;<br \/>\nimport org.bsc.langgraph4j.prebuilt.MessagesState;<br \/>\nimport org.bsc.langgraph4j.prebuilt.MessagesStateGraph;<\/p>\n<p>import java.util.Map;<\/p>\n<p>import static org.bsc.langgraph4j.StateGraph.END;<br \/>\nimport static org.bsc.langgraph4j.StateGraph.START;<br \/>\nimport static org.bsc.langgraph4j.action.AsyncNodeAction.node_async;<\/p>\n<p>\/**<br \/>\n * \u7b80\u5316\u7248\u7f51\u7ad9\u751f\u6210\u5de5\u4f5c\u6d41\u5e94\u7528 &#8211; \u4f7f\u7528 MessagesState<br \/>\n *\/<br \/>\n&#064;Slf4j<br \/>\npublic class SimpleWorkflowApp {<\/p>\n<p>    \/**<br \/>\n     * \u521b\u5efa\u5de5\u4f5c\u8282\u70b9\u7684\u901a\u7528\u65b9\u6cd5<br \/>\n     *\/<br \/>\n    static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; makeNode(String message) {<br \/>\n        return node_async(state -&gt; {<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: {}&#034;, message);<br \/>\n            return Map.of(&#034;messages&#034;, message);<br \/>\n        });<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) throws GraphStateException {<br \/>\n        \/\/ \u521b\u5efa\u5de5\u4f5c\u6d41\u56fe<br \/>\n        CompiledGraph&lt;MessagesState&lt;String&gt;&gt; workflow &#061; new MessagesStateGraph&lt;String&gt;()<br \/>\n        \/\/ \u6dfb\u52a0\u8282\u70b9<br \/>\n        .addNode(&#034;image_collector&#034;, makeNode(&#034;\u83b7\u53d6\u56fe\u7247\u7d20\u6750&#034;))<br \/>\n        .addNode(&#034;prompt_enhancer&#034;, makeNode(&#034;\u589e\u5f3a\u63d0\u793a\u8bcd&#034;))<br \/>\n        .addNode(&#034;router&#034;, makeNode(&#034;\u667a\u80fd\u8def\u7531\u9009\u62e9&#034;))<br \/>\n        .addNode(&#034;code_generator&#034;, makeNode(&#034;\u7f51\u7ad9\u4ee3\u7801\u751f\u6210&#034;))<br \/>\n        .addNode(&#034;project_builder&#034;, makeNode(&#034;\u9879\u76ee\u6784\u5efa&#034;))<\/p>\n<p>        \/\/ \u6dfb\u52a0\u8fb9<br \/>\n        .addEdge(START, &#034;image_collector&#034;)                \/\/ \u5f00\u59cb -&gt; \u56fe\u7247\u6536\u96c6<br \/>\n        .addEdge(&#034;image_collector&#034;, &#034;prompt_enhancer&#034;)    \/\/ \u56fe\u7247\u6536\u96c6 -&gt; \u63d0\u793a\u8bcd\u589e\u5f3a<br \/>\n        .addEdge(&#034;prompt_enhancer&#034;, &#034;router&#034;)             \/\/ \u63d0\u793a\u8bcd\u589e\u5f3a -&gt; \u667a\u80fd\u8def\u7531<br \/>\n        .addEdge(&#034;router&#034;, &#034;code_generator&#034;)              \/\/ \u667a\u80fd\u8def\u7531 -&gt; \u4ee3\u7801\u751f\u6210<br \/>\n        .addEdge(&#034;code_generator&#034;, &#034;project_builder&#034;)     \/\/ \u4ee3\u7801\u751f\u6210 -&gt; \u9879\u76ee\u6784\u5efa<br \/>\n        .addEdge(&#034;project_builder&#034;, END)                  \/\/ \u9879\u76ee\u6784\u5efa -&gt; \u7ed3\u675f<\/p>\n<p>        \/\/ \u7f16\u8bd1\u5de5\u4f5c\u6d41<br \/>\n        .compile();<\/p>\n<p>        log.info(&#034;\u5f00\u59cb\u6267\u884c\u5de5\u4f5c\u6d41&#034;);<\/p>\n<p>        GraphRepresentation graph &#061; workflow.getGraph(GraphRepresentation.Type.MERMAID);<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u56fe: \\\\n{}&#034;, graph.content());<\/p>\n<p>        \/\/ \u6267\u884c\u5de5\u4f5c\u6d41<br \/>\n        int stepCounter &#061; 1;<br \/>\n        for (NodeOutput&lt;MessagesState&lt;String&gt;&gt; step : workflow.stream(Map.of())) {<br \/>\n            log.info(&#034;&#8212; \u7b2c {} \u6b65\u5b8c\u6210 &#8212;&#034;, stepCounter);<br \/>\n            log.info(&#034;\u6b65\u9aa4\u8f93\u51fa: {}&#034;, step);<br \/>\n            stepCounter&#043;&#043;;<br \/>\n        }<\/p>\n<p>        log.info(&#034;\u5de5\u4f5c\u6d41\u6267\u884c\u5b8c\u6210&#xff01;&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"WuY9q\" style=\"background-color:transparent\">\u5b9a\u4e49\u72b6\u6001<\/h4>\n<p id=\"uba342b5a\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"690\" id=\"u72f58514\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142606-698c917e4848c.png\" width=\"1023\" \/><\/p>\n<p id=\"u18ebde8e\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"176\" id=\"VxmFq\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142606-698c917e83bd3.png\" width=\"936\" \/><\/p>\n<p id=\"u231444e7\">\u5b98\u65b9\u63d0\u4f9b\u7684\u72b6\u6001\u7c7b\u9ed8\u8ba4\u662fMessagesState\u6d88\u606f\u5217\u8868\u7ed3\u6784&#xff0c;\u4f46\u662f\u5f88\u660e\u663e\u6211\u4eec\u662f\u9700\u8981\u7ef4\u62a4\u7684\u72b6\u6001\u662f\u5305\u542b\u591a\u4e2a\u5b57\u6bb5&#xff0c;\u5e94\u8be5\u662f\u4e00\u4e2aMap\u6216\u7c7b\u7684\u7ed3\u6784&#xff0c;\u56e0\u6b64\u6211\u4eec\u9700\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2aWorkflowContext\u72b6\u6001\u4e0a\u4e0b\u6587\u7c7b\u3002\u800c\u4e14\u4e3a\u4e86\u548cLangGraph4j\u5de5\u4f5c\u6d41\u56fe\u9700\u8981\u7684AgentState\u517c\u5bb9&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5c06WorkflowContext\u5bf9\u8c61\u5f53\u4f5c\u4e00\u4e2akey\/value\u5b58\u653e\u5230MessagesState\u4e2d&#xff0c;\u9700\u8981\u65f6\u901a\u8fc7state.data().getKey\u83b7\u53d6\u3002<\/p>\n<p id=\"ua0dcbea4\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"379\" id=\"u5a3d4460\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142606-698c917ea3187.png\" width=\"923\" \/><\/p>\n<p id=\"u1c9535fe\">\u5b9a\u4e49\u56fe\u7247\u8d44\u6e90\u5bf9\u8c61\u548c\u56fe\u7247\u679a\u4e3e\u7c7b&#xff0c;\u4ee5\u53ca\u81ea\u5b9a\u4e49WorkflowContext\u4e0a\u4e0b\u6587\u7c7b&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>&#064;Getter<br \/>\npublic enum ImageCategoryEnum {<\/p>\n<p>    CONTENT(&#034;\u5185\u5bb9\u56fe\u7247&#034;, &#034;CONTENT&#034;),<br \/>\n    LOGO(&#034;LOGO\u56fe\u7247&#034;, &#034;LOGO&#034;),<br \/>\n    ILLUSTRATION(&#034;\u63d2\u753b\u56fe\u7247&#034;, &#034;ILLUSTRATION&#034;),<br \/>\n    ARCHITECTURE(&#034;\u67b6\u6784\u56fe\u7247&#034;, &#034;ARCHITECTURE&#034;);<\/p>\n<p>    private final String text;<\/p>\n<p>    private final String value;<\/p>\n<p>    ImageCategoryEnum(String text, String value) {<br \/>\n        this.text &#061; text;<br \/>\n        this.value &#061; value;<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u6839\u636e value \u83b7\u53d6\u679a\u4e3e<br \/>\n     *<br \/>\n     * &#064;param value \u679a\u4e3e\u503c\u7684value<br \/>\n     * &#064;return \u679a\u4e3e\u503c<br \/>\n     *\/<br \/>\n    public static ImageCategoryEnum getEnumByValue(String value) {<br \/>\n        if (ObjUtil.isEmpty(value)) {<br \/>\n            return null;<br \/>\n        }<br \/>\n        for (ImageCategoryEnum anEnum : ImageCategoryEnum.values()) {<br \/>\n            if (anEnum.value.equals(value)) {<br \/>\n                return anEnum;<br \/>\n            }<br \/>\n        }<br \/>\n        return null;<br \/>\n    }<br \/>\n}<br \/>\n\/**<br \/>\n * \u56fe\u7247\u8d44\u6e90\u5bf9\u8c61<br \/>\n *\/<br \/>\n&#064;Data<br \/>\n&#064;Builder<br \/>\n&#064;NoArgsConstructor<br \/>\n&#064;AllArgsConstructor<br \/>\npublic class ImageResource implements Serializable {<\/p>\n<p>    \/**<br \/>\n     * \u56fe\u7247\u7c7b\u522b<br \/>\n     *\/<br \/>\n    private ImageCategoryEnum category;<\/p>\n<p>    \/**<br \/>\n     * \u56fe\u7247\u63cf\u8ff0<br \/>\n     *\/<br \/>\n    private String description;<\/p>\n<p>    \/**<br \/>\n     * \u56fe\u7247\u5730\u5740<br \/>\n     *\/<br \/>\n    private String url;<\/p>\n<p>    &#064;Serial<br \/>\n    private static final long serialVersionUID &#061; 1L;<br \/>\n}<br \/>\n\/**<br \/>\n * \u5de5\u4f5c\u6d41\u4e0a\u4e0b\u6587 &#8211; \u5b58\u50a8\u6240\u6709\u72b6\u6001\u4fe1\u606f<br \/>\n *\/<br \/>\n&#064;Data<br \/>\n&#064;Builder<br \/>\n&#064;NoArgsConstructor<br \/>\n&#064;AllArgsConstructor<br \/>\npublic class WorkflowContext implements Serializable {<\/p>\n<p>    \/**<br \/>\n     * WorkflowContext \u5728 MessagesState \u4e2d\u7684\u5b58\u50a8key<br \/>\n     *\/<br \/>\n    public static final String WORKFLOW_CONTEXT_KEY &#061; &#034;workflowContext&#034;;<\/p>\n<p>    \/**<br \/>\n     * \u5f53\u524d\u6267\u884c\u6b65\u9aa4<br \/>\n     *\/<br \/>\n    private String currentStep;<\/p>\n<p>    \/**<br \/>\n     * \u7528\u6237\u539f\u59cb\u8f93\u5165\u7684\u63d0\u793a\u8bcd<br \/>\n     *\/<br \/>\n    private String originalPrompt;<\/p>\n<p>    \/**<br \/>\n     * \u56fe\u7247\u8d44\u6e90\u5b57\u7b26\u4e32<br \/>\n     *\/<br \/>\n    private String imageListStr;<\/p>\n<p>    \/**<br \/>\n     * \u56fe\u7247\u8d44\u6e90\u5217\u8868<br \/>\n     *\/<br \/>\n    private List&lt;ImageResource&gt; imageList;<\/p>\n<p>    \/**<br \/>\n     * \u589e\u5f3a\u540e\u7684\u63d0\u793a\u8bcd<br \/>\n     *\/<br \/>\n    private String enhancedPrompt;<\/p>\n<p>    \/**<br \/>\n     * \u4ee3\u7801\u751f\u6210\u7c7b\u578b<br \/>\n     *\/<br \/>\n    private CodeGenTypeEnum generationType;<\/p>\n<p>    \/**<br \/>\n     * \u751f\u6210\u7684\u4ee3\u7801\u76ee\u5f55<br \/>\n     *\/<br \/>\n    private String generatedCodeDir;<\/p>\n<p>    \/**<br \/>\n     * \u6784\u5efa\u6210\u529f\u7684\u76ee\u5f55<br \/>\n     *\/<br \/>\n    private String buildResultDir;<\/p>\n<p>    \/**<br \/>\n     * \u9519\u8bef\u4fe1\u606f<br \/>\n     *\/<br \/>\n    private String errorMessage;<\/p>\n<p>    &#064;Serial<br \/>\n    private static final long serialVersionUID &#061; 1L;<\/p>\n<p>    \/\/ &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u4e0a\u4e0b\u6587\u64cd\u4f5c\u65b9\u6cd5 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p>    \/**<br \/>\n     * \u4ece MessagesState \u4e2d\u83b7\u53d6 WorkflowContext<br \/>\n     *\/<br \/>\n    public static WorkflowContext getContext(MessagesState&lt;String&gt; state) {<br \/>\n        return (WorkflowContext) state.data().get(WORKFLOW_CONTEXT_KEY);<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u5c06 WorkflowContext \u4fdd\u5b58\u5230 MessagesState \u4e2d<br \/>\n     *\/<br \/>\n    public static Map&lt;String, Object&gt; saveContext(WorkflowContext context) {<br \/>\n        return Map.of(WORKFLOW_CONTEXT_KEY, context);<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u7723116b\">\u4fee\u6539\u5de5\u4f5c\u6d41\u56fe\u7ed3\u6784&#xff0c;\u5f15\u5165\u72b6\u6001\u5b8c\u5584\u7b80\u5355\u5de5\u4f5c\u6d41\u56fe&#xff0c;\u4e0d\u8fdb\u884c\u72b6\u6001\u6d41\u8f6c\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>\/**<br \/>\n * \u7b80\u5316\u7248\u5e26\u72b6\u6001\u5b9a\u4e49\u7684\u5de5\u4f5c\u6d41 &#8211; \u53ea\u5b9a\u4e49\u72b6\u6001\u7ed3\u6784&#xff0c;\u4e0d\u5b9e\u73b0\u5177\u4f53\u6d41\u8f6c<br \/>\n *\/<br \/>\n&#064;Slf4j<br \/>\npublic class SimpleStatefulWorkflowApp {<\/p>\n<p>    \/**<br \/>\n     * \u521b\u5efa\u5e26\u72b6\u6001\u611f\u77e5\u7684\u5de5\u4f5c\u8282\u70b9<br \/>\n     *\/<br \/>\n    static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; makeStatefulNode(String nodeName, String message) {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: {} &#8211; {}&#034;, nodeName, message);<br \/>\n            \/\/ \u53ea\u8bb0\u5f55\u5f53\u524d\u6b65\u9aa4&#xff0c;\u4e0d\u505a\u5177\u4f53\u7684\u72b6\u6001\u6d41\u8f6c<br \/>\n            if (context !&#061; null) {<br \/>\n                context.setCurrentStep(nodeName);<br \/>\n            }<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) throws GraphStateException {<br \/>\n        \/\/ \u521b\u5efa\u5de5\u4f5c\u6d41\u56fe<br \/>\n        CompiledGraph&lt;MessagesState&lt;String&gt;&gt; workflow &#061; new MessagesStateGraph&lt;String&gt;()<br \/>\n        \/\/ \u6dfb\u52a0\u8282\u70b9 &#8211; \u4f7f\u7528\u5e26\u72b6\u6001\u611f\u77e5\u7684\u8282\u70b9<br \/>\n        .addNode(&#034;image_collector&#034;, makeStatefulNode(&#034;image_collector&#034;, &#034;\u83b7\u53d6\u56fe\u7247\u7d20\u6750&#034;))<br \/>\n        .addNode(&#034;prompt_enhancer&#034;, makeStatefulNode(&#034;prompt_enhancer&#034;, &#034;\u589e\u5f3a\u63d0\u793a\u8bcd&#034;))<br \/>\n        .addNode(&#034;router&#034;, makeStatefulNode(&#034;router&#034;, &#034;\u667a\u80fd\u8def\u7531\u9009\u62e9&#034;))<br \/>\n        .addNode(&#034;code_generator&#034;, makeStatefulNode(&#034;code_generator&#034;, &#034;\u7f51\u7ad9\u4ee3\u7801\u751f\u6210&#034;))<br \/>\n        .addNode(&#034;project_builder&#034;, makeStatefulNode(&#034;project_builder&#034;, &#034;\u9879\u76ee\u6784\u5efa&#034;))<\/p>\n<p>        \/\/ \u6dfb\u52a0\u8fb9<br \/>\n        .addEdge(START, &#034;image_collector&#034;)<br \/>\n        .addEdge(&#034;image_collector&#034;, &#034;prompt_enhancer&#034;)<br \/>\n        .addEdge(&#034;prompt_enhancer&#034;, &#034;router&#034;)<br \/>\n        .addEdge(&#034;router&#034;, &#034;code_generator&#034;)<br \/>\n        .addEdge(&#034;code_generator&#034;, &#034;project_builder&#034;)<br \/>\n        .addEdge(&#034;project_builder&#034;, END)<\/p>\n<p>        \/\/ \u7f16\u8bd1\u5de5\u4f5c\u6d41<br \/>\n        .compile();<\/p>\n<p>        \/\/ \u521d\u59cb\u5316 WorkflowContext &#8211; \u53ea\u8bbe\u7f6e\u57fa\u672c\u4fe1\u606f<br \/>\n        WorkflowContext initialContext &#061; WorkflowContext.builder()<br \/>\n        .originalPrompt(&#034;\u521b\u5efa\u4e00\u4e2a\u5c0f\u697c\u7684\u4e2a\u4eba\u535a\u5ba2\u7f51\u7ad9&#034;)<br \/>\n        .currentStep(&#034;\u521d\u59cb\u5316&#034;)<br \/>\n        .build();<\/p>\n<p>        log.info(&#034;\u521d\u59cb\u8f93\u5165: {}&#034;, initialContext.getOriginalPrompt());<br \/>\n        log.info(&#034;\u5f00\u59cb\u6267\u884c\u5de5\u4f5c\u6d41&#034;);<\/p>\n<p>        \/\/ \u663e\u793a\u5de5\u4f5c\u6d41\u56fe<br \/>\n        GraphRepresentation graph &#061; workflow.getGraph(GraphRepresentation.Type.MERMAID);<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u56fe:\\\\n{}&#034;, graph.content());<\/p>\n<p>        \/\/ \u6267\u884c\u5de5\u4f5c\u6d41<br \/>\n        int stepCounter &#061; 1;<br \/>\n        for (NodeOutput&lt;MessagesState&lt;String&gt;&gt; step : workflow.stream(Map.of(WorkflowContext.WORKFLOW_CONTEXT_KEY, initialContext))) {<br \/>\n            log.info(&#034;&#8212; \u7b2c {} \u6b65\u5b8c\u6210 &#8212;&#034;, stepCounter);<br \/>\n            \/\/ \u663e\u793a\u5f53\u524d\u72b6\u6001<br \/>\n            WorkflowContext currentContext &#061; WorkflowContext.getContext(step.state());<br \/>\n            if (currentContext !&#061; null) {<br \/>\n                log.info(&#034;\u5f53\u524d\u6b65\u9aa4\u4e0a\u4e0b\u6587: {}&#034;, currentContext);<br \/>\n            }<br \/>\n            stepCounter&#043;&#043;;<br \/>\n        }<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u6267\u884c\u5b8c\u6210&#xff01;&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"dMLhG\">\u5b9a\u4e49\u5de5\u4f5c\u8282\u70b9&#xff08;\u5e76\u4f7f\u7528Mock\u5047\u6570\u636e\u6765\u6a21\u62df\u72b6\u6001\u6d41\u8f6c&#xff09;<\/h4>\n<p id=\"udddf0dd8\">\u5b9a\u4e49\u56fe\u7247\u6536\u96c6\u8282\u70b9&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class ImageCollectorNode {<br \/>\n    public static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; create() {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: \u56fe\u7247\u6536\u96c6&#034;);<\/p>\n<p>            \/\/ TODO: \u5b9e\u9645\u6267\u884c\u56fe\u7247\u6536\u96c6\u903b\u8f91<\/p>\n<p>            \/\/ \u7b80\u5355\u7684\u5047\u6570\u636e<br \/>\n            List&lt;ImageResource&gt; imageList &#061; Arrays.asList(<br \/>\n                ImageResource.builder()<br \/>\n                .category(ImageCategoryEnum.CONTENT)<br \/>\n                .description(&#034;\u5047\u6570\u636e\u56fe\u72471&#034;)<br \/>\n                .url(&#034;https:\/\/www.codefather.cn\/logo.png&#034;)<br \/>\n                .build(),<br \/>\n                ImageResource.builder()<br \/>\n                .category(ImageCategoryEnum.LOGO)<br \/>\n                .description(&#034;\u5047\u6570\u636e\u56fe\u72472&#034;)<br \/>\n                .url(&#034;https:\/\/www.codefather.cn\/logo.png&#034;)<br \/>\n                .build()<br \/>\n            );<\/p>\n<p>            \/\/ \u66f4\u65b0\u72b6\u6001<br \/>\n            context.setCurrentStep(&#034;\u56fe\u7247\u6536\u96c6&#034;);<br \/>\n            context.setImageList(imageList);<br \/>\n            log.info(&#034;\u56fe\u7247\u6536\u96c6\u5b8c\u6210&#xff0c;\u5171\u6536\u96c6 {} \u5f20\u56fe\u7247&#034;, imageList.size());<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u63afc301\">\u5b9a\u4e49\u63d0\u793a\u8bcd\u589e\u5f3a\u8282\u70b9&#xff0c;\u4ee3\u7801\u5982\u4e0b<\/p>\n<p>&#064;Slf4j<br \/>\npublic class PromptEnhancerNode {<br \/>\n    public static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; create() {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: \u63d0\u793a\u8bcd\u589e\u5f3a&#034;);<\/p>\n<p>            \/\/ TODO: \u5b9e\u9645\u6267\u884c\u63d0\u793a\u8bcd\u589e\u5f3a\u903b\u8f91<\/p>\n<p>            \/\/ \u7b80\u5355\u7684\u5047\u6570\u636e<br \/>\n            String enhancedPrompt &#061; &#034;\u8fd9\u662f\u589e\u5f3a\u540e\u7684\u5047\u6570\u636e\u63d0\u793a\u8bcd&#034;;<\/p>\n<p>            \/\/ \u66f4\u65b0\u72b6\u6001<br \/>\n            context.setCurrentStep(&#034;\u63d0\u793a\u8bcd\u589e\u5f3a&#034;);<br \/>\n            context.setEnhancedPrompt(enhancedPrompt);<br \/>\n            log.info(&#034;\u63d0\u793a\u8bcd\u589e\u5f3a\u5b8c\u6210&#034;);<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"uf347064f\">\u5b9a\u4e49\u667a\u80fd\u8def\u7531\u8282\u70b9&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class RouterNode {<br \/>\n    public static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; create() {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: \u667a\u80fd\u8def\u7531&#034;);<\/p>\n<p>            \/\/ TODO: \u5b9e\u9645\u6267\u884c\u667a\u80fd\u8def\u7531\u903b\u8f91<\/p>\n<p>            \/\/ \u7b80\u5355\u7684\u5047\u6570\u636e<br \/>\n            CodeGenTypeEnum generationType &#061; CodeGenTypeEnum.HTML;<br \/>\n            \/\/ \u66f4\u65b0\u72b6\u6001<br \/>\n            context.setCurrentStep(&#034;\u667a\u80fd\u8def\u7531&#034;);<br \/>\n            context.setGenerationType(generationType);<br \/>\n            log.info(&#034;\u8def\u7531\u51b3\u7b56\u5b8c\u6210&#xff0c;\u9009\u62e9\u7c7b\u578b: {}&#034;, generationType.getText());<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u5df4a36e\">\u5b9a\u4e49\u4ee3\u7801\u751f\u6210\u8282\u70b9&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class CodeGeneratorNode {<br \/>\n    public static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; create() {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: \u4ee3\u7801\u751f\u6210&#034;);<\/p>\n<p>            \/\/ TODO: \u5b9e\u9645\u6267\u884c\u4ee3\u7801\u751f\u6210\u903b\u8f91<\/p>\n<p>            \/\/ \u7b80\u5355\u7684\u5047\u6570\u636e<br \/>\n            String generatedCodeDir &#061; &#034;\/tmp\/generated\/fake-code&#034;;<br \/>\n            \/\/ \u66f4\u65b0\u72b6\u6001<br \/>\n            context.setCurrentStep(&#034;\u4ee3\u7801\u751f\u6210&#034;);<br \/>\n            context.setGeneratedCodeDir(generatedCodeDir);<br \/>\n            log.info(&#034;\u4ee3\u7801\u751f\u6210\u5b8c\u6210&#xff0c;\u76ee\u5f55: {}&#034;, generatedCodeDir);<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u2ad47172\">\u5b9a\u4e49\u9879\u76ee\u6784\u5efa\u8282\u70b9&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class ProjectBuilderNode {<br \/>\n    public static AsyncNodeAction&lt;MessagesState&lt;String&gt;&gt; create() {<br \/>\n        return node_async(state -&gt; {<br \/>\n            WorkflowContext context &#061; WorkflowContext.getContext(state);<br \/>\n            log.info(&#034;\u6267\u884c\u8282\u70b9: \u9879\u76ee\u6784\u5efa&#034;);<\/p>\n<p>            \/\/ TODO: \u5b9e\u9645\u6267\u884c\u9879\u76ee\u6784\u5efa\u903b\u8f91<\/p>\n<p>            \/\/ \u7b80\u5355\u7684\u5047\u6570\u636e<br \/>\n            String buildResultDir &#061; &#034;\/tmp\/build\/fake-build&#034;;<\/p>\n<p>            \/\/ \u66f4\u65b0\u72b6\u6001<br \/>\n            context.setCurrentStep(&#034;\u9879\u76ee\u6784\u5efa&#034;);<br \/>\n            context.setBuildResultDir(buildResultDir);<br \/>\n            log.info(&#034;\u9879\u76ee\u6784\u5efa\u5b8c\u6210&#xff0c;\u7ed3\u679c\u76ee\u5f55: {}&#034;, buildResultDir);<br \/>\n            return WorkflowContext.saveContext(context);<br \/>\n        });<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u1d6896b4\">\u5de5\u4f5c\u6d41\u56fe\u5e94\u7528\u5404\u4e2a\u5de5\u4f5c\u8282\u70b9&#xff08;\u6a21\u62df\u6d41\u8f6c&#xff09;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class WorkflowApp {<\/p>\n<p>    public static void main(String[] args) throws GraphStateException {<br \/>\n        \/\/ \u521b\u5efa\u5de5\u4f5c\u6d41\u56fe<br \/>\n        CompiledGraph&lt;MessagesState&lt;String&gt;&gt; workflow &#061; new MessagesStateGraph&lt;String&gt;()<br \/>\n        \/\/ \u6dfb\u52a0\u8282\u70b9 &#8211; \u4f7f\u7528\u771f\u5b9e\u7684\u5de5\u4f5c\u8282\u70b9<br \/>\n        .addNode(&#034;image_collector&#034;, ImageCollectorNode.create())<br \/>\n        .addNode(&#034;prompt_enhancer&#034;, PromptEnhancerNode.create())<br \/>\n        .addNode(&#034;router&#034;, RouterNode.create())<br \/>\n        .addNode(&#034;code_generator&#034;, CodeGeneratorNode.create())<br \/>\n        .addNode(&#034;project_builder&#034;, ProjectBuilderNode.create())<br \/>\n        \/\/ \u6dfb\u52a0\u8fb9<br \/>\n        .addEdge(START, &#034;image_collector&#034;)<br \/>\n        .addEdge(&#034;image_collector&#034;, &#034;prompt_enhancer&#034;)<br \/>\n        .addEdge(&#034;prompt_enhancer&#034;, &#034;router&#034;)<br \/>\n        .addEdge(&#034;router&#034;, &#034;code_generator&#034;)<br \/>\n        .addEdge(&#034;code_generator&#034;, &#034;project_builder&#034;)<br \/>\n        .addEdge(&#034;project_builder&#034;, END)<br \/>\n        \/\/ \u7f16\u8bd1\u5de5\u4f5c\u6d41<br \/>\n        .compile();<\/p>\n<p>        \/\/ \u521d\u59cb\u5316 WorkflowContext &#8211; \u53ea\u8bbe\u7f6e\u57fa\u672c\u4fe1\u606f<br \/>\n        WorkflowContext initialContext &#061; WorkflowContext.builder()<br \/>\n        .originalPrompt(&#034;\u521b\u5efa\u4e00\u4e2a\u5c0f\u697c\u7684\u4e2a\u4eba\u535a\u5ba2\u7f51\u7ad9&#034;)<br \/>\n        .currentStep(&#034;\u521d\u59cb\u5316&#034;)<br \/>\n        .build();<br \/>\n        log.info(&#034;\u521d\u59cb\u8f93\u5165: {}&#034;, initialContext.getOriginalPrompt());<br \/>\n        log.info(&#034;\u5f00\u59cb\u6267\u884c\u5de5\u4f5c\u6d41&#034;);<\/p>\n<p>        \/\/ \u663e\u793a\u5de5\u4f5c\u6d41\u56fe<br \/>\n        GraphRepresentation graph &#061; workflow.getGraph(GraphRepresentation.Type.MERMAID);<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u56fe:\\\\n{}&#034;, graph.content());<\/p>\n<p>        \/\/ \u6267\u884c\u5de5\u4f5c\u6d41<br \/>\n        int stepCounter &#061; 1;<br \/>\n        for (NodeOutput&lt;MessagesState&lt;String&gt;&gt; step : workflow.stream(Map.of(WorkflowContext.WORKFLOW_CONTEXT_KEY, initialContext))) {<br \/>\n            log.info(&#034;&#8212; \u7b2c {} \u6b65\u5b8c\u6210 &#8212;&#034;, stepCounter);<br \/>\n            \/\/ \u663e\u793a\u5f53\u524d\u72b6\u6001<br \/>\n            WorkflowContext currentContext &#061; WorkflowContext.getContext(step.state());<br \/>\n            if (currentContext !&#061; null) {<br \/>\n                log.info(&#034;\u5f53\u524d\u6b65\u9aa4\u4e0a\u4e0b\u6587: {}&#034;, currentContext);<br \/>\n            }<br \/>\n            stepCounter&#043;&#043;;<br \/>\n        }<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u6267\u884c\u5b8c\u6210&#xff01;&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"s6Q2g\">\u4f9d\u6b21\u5f00\u53d1\u771f\u5b9e\u5de5\u4f5c\u8282\u70b9<\/h4>\n<p>\u6b64\u5904\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u8fdb\u884c\u5f00\u53d1\u8282\u70b9\u3002<\/p>\n<h4 id=\"coODY\">\u6700\u540e\u5728\u5de5\u4f5c\u6d41\u4e2d\u4f7f\u7528\u8282\u70b9<\/h4>\n<p id=\"u15c8ff40\">\u539f\u672c\u7684WorkflowApp\u5de5\u4f5c\u6d41\u662f\u4f7f\u7528main\u8fdb\u884c\u6a21\u62df\u8fd0\u884c&#xff0c;\u73b0\u5728\u4f7f\u7528\u771f\u5b9e\u5de5\u4f5c\u8282\u70b9\u8fdb\u884c\u5de5\u4f5c\u6d41\u6539\u9020&#xff1a;<\/p>\n<p>&#064;Slf4j<br \/>\npublic class CodeGenWorkflow {<\/p>\n<p>    \/**<br \/>\n     * \u521b\u5efa\u5b8c\u6574\u7684\u5de5\u4f5c\u6d41<br \/>\n     *\/<br \/>\n    public CompiledGraph&lt;MessagesState&lt;String&gt;&gt; createWorkflow() {<br \/>\n        try {<br \/>\n            return new MessagesStateGraph&lt;String&gt;()<br \/>\n            \/\/ \u6dfb\u52a0\u8282\u70b9 &#8211; \u4f7f\u7528\u5b8c\u6574\u5b9e\u73b0\u7684\u8282\u70b9<br \/>\n            .addNode(&#034;image_collector&#034;, ImageCollectorNode.create())<br \/>\n            .addNode(&#034;prompt_enhancer&#034;, PromptEnhancerNode.create())<br \/>\n            .addNode(&#034;router&#034;, RouterNode.create())<br \/>\n            .addNode(&#034;code_generator&#034;, CodeGeneratorNode.create())<br \/>\n            .addNode(&#034;project_builder&#034;, ProjectBuilderNode.create())<\/p>\n<p>            \/\/ \u6dfb\u52a0\u8fb9<br \/>\n            .addEdge(START, &#034;image_collector&#034;)<br \/>\n            .addEdge(&#034;image_collector&#034;, &#034;prompt_enhancer&#034;)<br \/>\n            .addEdge(&#034;prompt_enhancer&#034;, &#034;router&#034;)<br \/>\n            .addEdge(&#034;router&#034;, &#034;code_generator&#034;)<br \/>\n            .addEdge(&#034;code_generator&#034;, &#034;project_builder&#034;)<br \/>\n            .addEdge(&#034;project_builder&#034;, END)<\/p>\n<p>            \/\/ \u7f16\u8bd1\u5de5\u4f5c\u6d41<br \/>\n            .compile();<br \/>\n        } catch (GraphStateException e) {<br \/>\n            throw new BusinessException(ErrorCode.OPERATION_ERROR, &#034;\u5de5\u4f5c\u6d41\u521b\u5efa\u5931\u8d25&#034;);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u6267\u884c\u5de5\u4f5c\u6d41<br \/>\n     *\/<br \/>\n    public WorkflowContext executeWorkflow(String originalPrompt) {<br \/>\n        CompiledGraph&lt;MessagesState&lt;String&gt;&gt; workflow &#061; createWorkflow();<\/p>\n<p>        \/\/ \u521d\u59cb\u5316 WorkflowContext<br \/>\n        WorkflowContext initialContext &#061; WorkflowContext.builder()<br \/>\n        .originalPrompt(originalPrompt)<br \/>\n        .currentStep(&#034;\u521d\u59cb\u5316&#034;)<br \/>\n        .build();<\/p>\n<p>        GraphRepresentation graph &#061; workflow.getGraph(GraphRepresentation.Type.MERMAID);<br \/>\n        log.info(&#034;\u5de5\u4f5c\u6d41\u56fe:\\\\n{}&#034;, graph.content());<br \/>\n        log.info(&#034;\u5f00\u59cb\u6267\u884c\u4ee3\u7801\u751f\u6210\u5de5\u4f5c\u6d41&#034;);<\/p>\n<p>        WorkflowContext finalContext &#061; null;<br \/>\n        int stepCounter &#061; 1;<br \/>\n        for (NodeOutput&lt;MessagesState&lt;String&gt;&gt; step : workflow.stream(<br \/>\n            Map.of(WorkflowContext.WORKFLOW_CONTEXT_KEY, initialContext))) {<br \/>\n            log.info(&#034;&#8212; \u7b2c {} \u6b65\u5b8c\u6210 &#8212;&#034;, stepCounter);<br \/>\n            \/\/ \u663e\u793a\u5f53\u524d\u72b6\u6001<br \/>\n            WorkflowContext currentContext &#061; WorkflowContext.getContext(step.state());<br \/>\n            if (currentContext !&#061; null) {<br \/>\n                finalContext &#061; currentContext;<br \/>\n                log.info(&#034;\u5f53\u524d\u6b65\u9aa4\u4e0a\u4e0b\u6587: {}&#034;, currentContext);<br \/>\n            }<br \/>\n            stepCounter&#043;&#043;;<br \/>\n        }<br \/>\n        log.info(&#034;\u4ee3\u7801\u751f\u6210\u5de5\u4f5c\u6d41\u6267\u884c\u5b8c\u6210&#xff01;&#034;);<br \/>\n        return finalContext;<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u11fb1f56\">\u6700\u540e\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u8fdb\u884c\u5de5\u4f5c\u6d41\u6548\u679c\u6d4b\u8bd5&#xff1a;<\/p>\n<p>&#064;SpringBootTest<br \/>\nclass CodeGenWorkflowTest {<\/p>\n<p>    &#064;Test<br \/>\n    void testTechBlogWorkflow() {<br \/>\n        WorkflowContext result &#061; new CodeGenWorkflow().executeWorkflow(&#034;\u521b\u5efa\u4e00\u4e2a\u6280\u672f\u535a\u5ba2\u7f51\u7ad9&#xff0c;\u9700\u8981\u5c55\u793a\u7f16\u7a0b\u6559\u7a0b\u548c\u7cfb\u7edf\u67b6\u6784&#034;);<br \/>\n        Assertions.assertNotNull(result);<br \/>\n        System.out.println(&#034;\u751f\u6210\u7c7b\u578b: &#034; &#043; result.getGenerationType());<br \/>\n        System.out.println(&#034;\u751f\u6210\u7684\u4ee3\u7801\u76ee\u5f55: &#034; &#043; result.getGeneratedCodeDir());<br \/>\n        System.out.println(&#034;\u6784\u5efa\u7ed3\u679c\u76ee\u5f55: &#034; &#043; result.getBuildResultDir());<br \/>\n    }<\/p>\n<p>    &#064;Test<br \/>\n    void testCorporateWorkflow() {<br \/>\n        WorkflowContext result &#061; new CodeGenWorkflow().executeWorkflow(&#034;\u521b\u5efa\u4f01\u4e1a\u5b98\u7f51&#xff0c;\u5c55\u793a\u516c\u53f8\u5f62\u8c61\u548c\u4e1a\u52a1\u4ecb\u7ecd&#034;);<br \/>\n        Assertions.assertNotNull(result);<br \/>\n        System.out.println(&#034;\u751f\u6210\u7c7b\u578b: &#034; &#043; result.getGenerationType());<br \/>\n        System.out.println(&#034;\u751f\u6210\u7684\u4ee3\u7801\u76ee\u5f55: &#034; &#043; result.getGeneratedCodeDir());<br \/>\n        System.out.println(&#034;\u6784\u5efa\u7ed3\u679c\u76ee\u5f55: &#034; &#043; result.getBuildResultDir());<br \/>\n    }<\/p>\n<p>    &#064;Test<br \/>\n    void testVueProjectWorkflow() {<br \/>\n        WorkflowContext result &#061; new CodeGenWorkflow().executeWorkflow(&#034;\u521b\u5efa\u4e00\u4e2aVue\u524d\u7aef\u9879\u76ee&#xff0c;\u5305\u542b\u7528\u6237\u7ba1\u7406\u548c\u6570\u636e\u5c55\u793a\u529f\u80fd&#034;);<br \/>\n        Assertions.assertNotNull(result);<br \/>\n        System.out.println(&#034;\u751f\u6210\u7c7b\u578b: &#034; &#043; result.getGenerationType());<br \/>\n        System.out.println(&#034;\u751f\u6210\u7684\u4ee3\u7801\u76ee\u5f55: &#034; &#043; result.getGeneratedCodeDir());<br \/>\n        System.out.println(&#034;\u6784\u5efa\u7ed3\u679c\u76ee\u5f55: &#034; &#043; result.getBuildResultDir());<br \/>\n    }<\/p>\n<p>    &#064;Test<br \/>\n    void testSimpleHtmlWorkflow() {<br \/>\n        WorkflowContext result &#061; new CodeGenWorkflow().executeWorkflow(&#034;\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u4e2a\u4eba\u4e3b\u9875&#034;);<br \/>\n        Assertions.assertNotNull(result);<br \/>\n        System.out.println(&#034;\u751f\u6210\u7c7b\u578b: &#034; &#043; result.getGenerationType());<br \/>\n        System.out.println(&#034;\u751f\u6210\u7684\u4ee3\u7801\u76ee\u5f55: &#034; &#043; result.getGeneratedCodeDir());<br \/>\n        System.out.println(&#034;\u6784\u5efa\u7ed3\u679c\u76ee\u5f55: &#034; &#043; result.getBuildResultDir());<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"u4a540bad\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"376\" id=\"ub6767f06\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142606-698c917ed127f.png\" width=\"960\" \/><\/p>\n<p id=\"u5785aa34\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"149\" id=\"ubc647eb5\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142607-698c917f11e04.png\" width=\"1404\" \/><\/p>\n<p id=\"u1b7324e8\">\u53ef\u4ee5\u591a\u6d4b\u8bd5\u51e0\u4e2a\u770b\u770b\u6548\u679c&#xff1a;<\/p>\n<p id=\"uda819861\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"912\" id=\"uc510fe5c\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142607-698c917f3181f.png\" width=\"1920\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u8fdb\u884cAI\u5de5\u4f5c\u6d41\u6539\u9020<br \/>\nDemo\u6f14\u793a<br \/>\n\u5f15\u5165\u4f9d\u8d56&#xff1a;<br \/>\n<!-- LangGraph4j --><br \/>\norg.bsc.langgraph4jlanggraph4j-core1.6.0-rc2<\/p>\n<p>\u53c2\u8003\u5b98\u65b9\u6587\u6863&#xff0c;\u7f16\u5199LangGraph4j\u7684demo&#xff0c;\u53ef\u4ee5\u770b\u770b\u5de5\u4f5c\u6d41\u7684\u5927<\/p>\n","protected":false},"author":2,"featured_media":75283,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7084,8000,99,997,292],"topic":[],"class_list":["post-75291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ai","tag-langgraph4j","tag-java","tag-langchain","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/75291.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9879\u76ee\u8fdb\u884cAI\u5de5\u4f5c\u6d41\u6539\u9020 Demo\u6f14\u793a \u5f15\u5165\u4f9d\u8d56&#xff1a;  org.bsc.langgraph4jlanggraph4j-core1.6.0-rc2  \u53c2\u8003\u5b98\u65b9\u6587\u6863&#xff0c;\u7f16\u5199LangGraph4j\u7684demo&#xff0c;\u53ef\u4ee5\u770b\u770b\u5de5\u4f5c\u6d41\u7684\u5927\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/75291.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-11T14:26:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142605-698c917dde2b8.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75291.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/75291.html\",\"name\":\"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-11T14:26:09+00:00\",\"dateModified\":\"2026-02-11T14:26:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/75291.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/75291.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75291.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/75291.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9879\u76ee\u8fdb\u884cAI\u5de5\u4f5c\u6d41\u6539\u9020 Demo\u6f14\u793a \u5f15\u5165\u4f9d\u8d56&#xff1a;  org.bsc.langgraph4jlanggraph4j-core1.6.0-rc2  \u53c2\u8003\u5b98\u65b9\u6587\u6863&#xff0c;\u7f16\u5199LangGraph4j\u7684demo&#xff0c;\u53ef\u4ee5\u770b\u770b\u5de5\u4f5c\u6d41\u7684\u5927","og_url":"https:\/\/www.wsisp.com\/helps\/75291.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-11T14:26:09+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260211142605-698c917dde2b8.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/75291.html","url":"https:\/\/www.wsisp.com\/helps\/75291.html","name":"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-11T14:26:09+00:00","dateModified":"2026-02-11T14:26:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/75291.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/75291.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/75291.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4f7f\u7528LangGraph4j\u5de5\u4f5c\u6d41\u6539\u9020\u9879\u76ee\u6d41\u7a0b\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=75291"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75291\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/75283"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=75291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=75291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=75291"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=75291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}