{"id":62514,"date":"2026-01-20T05:42:02","date_gmt":"2026-01-19T21:42:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/62514.html"},"modified":"2026-01-20T05:42:02","modified_gmt":"2026-01-19T21:42:02","slug":"langchain4j%e5%85%a5%e9%97%a8%ef%bc%9a%e9%93%be%e5%bc%8fai%e4%bb%bb%e5%8a%a1%e6%8b%86%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/62514.html","title":{"rendered":"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3"},"content":{"rendered":"<p>\u6838\u5fc3\u6982\u5ff5&#xff1a;\u94fe (Chain)<\/p>\n<p>LangChain4j \u7684\u6838\u5fc3\u601d\u60f3\u662f\u5c06\u590d\u6742\u7684\u4efb\u52a1\u62c6\u89e3\u4e3a\u4e00\u7cfb\u5217\u53ef\u7ec4\u5408\u7684\u6b65\u9aa4&#xff08;\u94fe\u63a5&#xff09;&#xff0c;\u5f62\u6210\u4e00\u4e2a\u201c\u94fe\u201d\u3002\u8fd9\u6709\u52a9\u4e8e\u6a21\u5757\u5316\u3001\u590d\u7528\u548c\u66f4\u6e05\u6670\u7684\u903b\u8f91\u3002<\/p>\n<p>\u57fa\u672c\u4f7f\u7528\u6b65\u9aa4<\/p>\n<li>\n<p>\u6dfb\u52a0\u4f9d\u8d56 \u5728\u4f60\u7684 Maven \u6216 Gradle \u9879\u76ee\u4e2d\u5f15\u5165 LangChain4j \u7684\u6838\u5fc3\u5e93\u4ee5\u53ca\u4f60\u8ba1\u5212\u4f7f\u7528\u7684 LLM \u63d0\u4f9b\u5546\u7684\u9002\u914d\u5668\u5e93&#xff08;\u5982 OpenAI, HuggingFace, LocalAI \u7b49&#xff09;\u3002\u4f8b\u5982&#xff0c;\u5bf9\u4e8e OpenAI&#xff1a;<\/p>\n<p>&lt;!&#8211; Maven &#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;dev.langchain4j&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;langchain4j-open-ai&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;0.28.0&lt;\/version&gt; &lt;!&#8211; \u8bf7\u4f7f\u7528\u6700\u65b0\u7248\u672c &#8211;&gt;<br \/>\n&lt;\/dependency&gt;<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e LLM \u5ba2\u6237\u7aef \u521b\u5efa\u4e00\u4e2a\u8fde\u63a5\u5230\u4f60\u9009\u62e9\u7684 LLM \u670d\u52a1\u7684\u5ba2\u6237\u7aef\u5b9e\u4f8b\u3002\u8fd9\u901a\u5e38\u9700\u8981\u63d0\u4f9b API \u5bc6\u94a5\u6216\u5176\u4ed6\u8ba4\u8bc1\u4fe1\u606f\u3002<\/p>\n<p>import dev.langchain4j.model.openai.OpenAiChatModel;<\/p>\n<p>\/\/ \u4f7f\u7528 OpenAI (\u9700\u8981 OPENAI_API_KEY \u73af\u5883\u53d8\u91cf)<br \/>\nOpenAiChatModel model &#061; OpenAiChatModel.builder()<br \/>\n        .modelName(&#034;gpt-3.5-turbo&#034;) \/\/ \u6307\u5b9a\u6a21\u578b<br \/>\n        .temperature(0.3) \/\/ \u63a7\u5236\u968f\u673a\u6027<br \/>\n        .build();<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u5e76\u6267\u884c\u94fe \u6700\u7b80\u5355\u7684\u94fe\u662f\u76f4\u63a5\u5411\u6a21\u578b\u53d1\u9001\u6d88\u606f\u5e76\u83b7\u53d6\u56de\u590d\u3002<\/p>\n<p>String userMessage &#061; &#034;Java-LangChain4j \u7684\u57fa\u672c\u4f7f\u7528\u662f\u600e\u6837\u7684&#xff1f;&#034;;<br \/>\nString response &#061; model.generate(userMessage);<br \/>\nSystem.out.println(response);<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 Prompt Templates (\u63d0\u793a\u6a21\u677f) \u4e3a\u4e86\u66f4\u7ed3\u6784\u5316\u5730\u751f\u6210\u8f93\u5165&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u63d0\u793a\u6a21\u677f\u3002\u6a21\u677f\u4e2d\u53ef\u4ee5\u7528 {{variable}} \u7684\u5f62\u5f0f\u5b9a\u4e49\u5360\u4f4d\u7b26\u3002<\/p>\n<p>import dev.langchain4j.model.openai.OpenAiChatModel;<br \/>\nimport dev.langchain4j.model.input.Prompt;<br \/>\nimport dev.langchain4j.model.input.structured.StructuredPrompt;<br \/>\nimport dev.langchain4j.model.input.template.Template;<\/p>\n<p>\/\/ \u5b9a\u4e49\u6a21\u677f<br \/>\nTemplate template &#061; Template.from(&#034;\u8bf7\u7528 {{language}} \u89e3\u91ca {{framework}} \u7684\u57fa\u672c\u4f7f\u7528\u3002&#034;);<\/p>\n<p>\/\/ \u586b\u5145\u6a21\u677f\u53d8\u91cf<br \/>\nPrompt prompt &#061; template.render(&#034;language&#034;, &#034;\u4e2d\u6587&#034;, &#034;framework&#034;, &#034;Java-LangChain4j&#034;);<\/p>\n<p>\/\/ \u53d1\u9001\u7ed9\u6a21\u578b<br \/>\nString response &#061; model.generate(prompt.text());<br \/>\nSystem.out.println(response);<\/p>\n<\/li>\n<li>\n<p>\u7ed3\u6784\u5316\u8f93\u51fa \u6709\u65f6\u6211\u4eec\u5e0c\u671b\u6a21\u578b\u7684\u8f93\u51fa\u662f\u7ed3\u6784\u5316\u7684&#xff08;\u5982 JSON \u5bf9\u8c61&#xff09;\u3002\u53ef\u4ee5\u7ed3\u5408\u63d0\u793a\u6a21\u677f\u548c &#064;StructuredPrompt \u6ce8\u89e3\u6765\u5f15\u5bfc\u6a21\u578b\u3002<\/p>\n<p>import dev.langchain4j.model.output.Response;<br \/>\nimport dev.langchain4j.model.output.structured.Description;<br \/>\nimport dev.langchain4j.model.output.structured.StructuredOutput;<\/p>\n<p>&#064;StructuredOutput<br \/>\npublic class FrameworkInfo {<br \/>\n    &#064;Description(&#034;\u6846\u67b6\u7684\u540d\u79f0&#034;)<br \/>\n    public String name;<br \/>\n    &#064;Description(&#034;\u6838\u5fc3\u6982\u5ff5&#xff0c;\u7528\u9017\u53f7\u5206\u9694&#034;)<br \/>\n    public String coreConcepts;<br \/>\n    &#064;Description(&#034;\u4e00\u4e2a\u7b80\u5355\u7684\u4f7f\u7528\u793a\u4f8b\u4ee3\u7801\u7247\u6bb5&#034;)<br \/>\n    public String exampleCode;<br \/>\n}<\/p>\n<p>\/\/ \u5728\u63d0\u793a\u4e2d\u8981\u6c42\u7ed3\u6784\u5316\u8f93\u51fa<br \/>\nTemplate template &#061; Template.from(&#034;\u8bf7\u63d0\u4f9b\u5173\u4e8e {{framework}} \u7684\u57fa\u672c\u4fe1\u606f&#xff0c;\u5305\u62ec\u540d\u79f0\u3001\u6838\u5fc3\u6982\u5ff5\u548c\u4e00\u4e2a\u7b80\u5355\u793a\u4f8b\u4ee3\u7801\u3002\\\\n{{format_instructions}}&#034;);<br \/>\n\/\/ &#8230; \u586b\u5145\u6a21\u677f&#xff0c;\u7279\u522b\u6ce8\u610f format_instructions \u9700\u8981\u63cf\u8ff0 FrameworkInfo \u7684\u7ed3\u6784<br \/>\nPrompt prompt &#061; &#8230;;<\/p>\n<p>\/\/ \u83b7\u53d6\u7ed3\u6784\u5316\u54cd\u5e94<br \/>\nResponse&lt;FrameworkInfo&gt; response &#061; model.generate(prompt, FrameworkInfo.class);<br \/>\nFrameworkInfo info &#061; response.content();<br \/>\nSystem.out.println(&#034;\u540d\u79f0: &#034; &#043; info.name);<br \/>\nSystem.out.println(&#034;\u6838\u5fc3\u6982\u5ff5: &#034; &#043; info.coreConcepts);<br \/>\nSystem.out.println(&#034;\u793a\u4f8b:\\\\n&#034; &#043; info.exampleCode);<\/p>\n<\/li>\n<p>\u5e38\u89c1\u5e94\u7528\u573a\u666f<\/p>\n<ul>\n<li>\u95ee\u7b54\u7cfb\u7edf&#xff1a;\u57fa\u4e8e\u7279\u5b9a\u6587\u6863\u6216\u77e5\u8bc6\u5e93\u56de\u7b54\u95ee\u9898\u3002<\/li>\n<li>\u6458\u8981\u751f\u6210&#xff1a;\u603b\u7ed3\u957f\u6587\u672c\u5185\u5bb9\u3002<\/li>\n<li>\u6587\u672c\u751f\u6210&#xff1a;\u64b0\u5199\u90ae\u4ef6\u3001\u6545\u4e8b\u3001\u4ee3\u7801\u7b49\u3002<\/li>\n<li>\u6570\u636e\u63d0\u53d6&#xff1a;\u4ece\u975e\u7ed3\u6784\u5316\u6587\u672c\u4e2d\u63d0\u53d6\u7ed3\u6784\u5316\u4fe1\u606f\u3002<\/li>\n<li>\u7ffb\u8bd1&#xff1a;\u6587\u672c\u7ffb\u8bd1\u3002<\/li>\n<li>\u804a\u5929\u673a\u5668\u4eba&#xff1a;\u6784\u5efa\u5bf9\u8bdd\u63a5\u53e3\u3002<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9879<\/p>\n<ul>\n<li>API \u6210\u672c\u4e0e\u9650\u5236&#xff1a;\u6ce8\u610f LLM API \u7684\u8c03\u7528\u6210\u672c\u548c\u901f\u7387\u9650\u5236\u3002<\/li>\n<li>\u63d0\u793a\u5de5\u7a0b&#xff1a;\u63d0\u793a (Prompt) \u7684\u8d28\u91cf\u5bf9\u8f93\u51fa\u7ed3\u679c\u5f71\u54cd\u5de8\u5927&#xff0c;\u9700\u8981\u7cbe\u5fc3\u8bbe\u8ba1\u3002<\/li>\n<li>\u9519\u8bef\u5904\u7406&#xff1a;\u7f51\u7edc\u9519\u8bef\u3001API \u9650\u5236\u3001\u6a21\u578b\u9519\u8bef\u7b49\u90fd\u9700\u8981\u59a5\u5584\u5904\u7406\u3002<\/li>\n<li>\u5185\u5bb9\u5b89\u5168&#xff1a;\u5bf9\u6a21\u578b\u751f\u6210\u7684\u5185\u5bb9\u8fdb\u884c\u5fc5\u8981\u7684\u5b89\u5168\u68c0\u67e5\u548c\u8fc7\u6ee4\u3002<\/li>\n<li>\u6a21\u578b\u9009\u62e9&#xff1a;\u4e0d\u540c\u7684\u6a21\u578b\u5728\u80fd\u529b\u3001\u6210\u672c\u548c\u901f\u5ea6\u4e0a\u6709\u5dee\u5f02&#xff0c;\u9700\u6839\u636e\u9700\u6c42\u9009\u62e9\u3002<\/li>\n<li>\u5e76\u53d1&#xff1a;OpenAiChatModel \u7b49\u5ba2\u6237\u7aef\u901a\u5e38\u662f\u7ebf\u7a0b\u5b89\u5168\u7684&#xff0c;\u53ef\u4ee5\u5b89\u5168\u5730\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u4ecb\u7ecd\u4e86 LangChain4j \u6700\u57fa\u7840\u7684\u4f7f\u7528\u65b9\u5f0f\u3002\u5b9e\u9645\u5e94\u7528\u4e2d&#xff0c;\u4f60\u4f1a\u63a5\u89e6\u5230\u66f4\u590d\u6742\u7684\u94fe\u7ed3\u6784&#xff08;\u5982 SequentialChain\u3001ConditionalChain&#xff09;\u3001\u8bb0\u5fc6\u7ba1\u7406\u3001\u5de5\u5177\u8c03\u7528&#xff08;\u8ba9\u6a21\u578b\u4f7f\u7528\u5916\u90e8\u5de5\u5177\u6216\u51fd\u6570&#xff09;\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002\u5efa\u8bae\u4ece\u5b98\u65b9\u6587\u6863\u548c\u793a\u4f8b\u5f00\u59cb\u6df1\u5165\u5b66\u4e60\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6838\u5fc3\u6982\u5ff5&#xff1a;\u94fe (Chain)LangChain4j \u7684\u6838\u5fc3\u601d\u60f3\u662f\u5c06\u590d\u6742\u7684\u4efb\u52a1\u62c6\u89e3\u4e3a\u4e00\u7cfb\u5217\u53ef\u7ec4\u5408\u7684\u6b65\u9aa4&#xff08;\u94fe\u63a5&#xff09;&#xff0c;\u5f62\u6210\u4e00\u4e2a\u201c\u94fe\u201d\u3002\u8fd9\u6709\u52a9\u4e8e\u6a21\u5757\u5316\u3001\u590d\u7528\u548c\u66f4\u6e05\u6670\u7684\u903b\u8f91\u3002\u57fa\u672c\u4f7f\u7528\u6b65\u9aa4\u6dfb\u52a0\u4f9d\u8d56 \u5728\u4f60\u7684 Maven \u6216 Gradle \u9879\u76ee\u4e2d\u5f15\u5165 LangChain4j \u7684\u6838\u5fc3\u5e93\u4ee5\u53ca\u4f60\u8ba1\u5212\u4f7f\u7528\u7684 LLM \u63d0\u4f9b\u5546\u7684\u9002\u914d\u5668\u5e93&#xff08;\u5982 OpenAI, HuggingFace, LocalAI \u7b49&#xff09;\u3002\u4f8b\u5982&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,190],"topic":[],"class_list":["post-62514","post","type-post","status-publish","format-standard","hentry","category-server","tag-python","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \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\/62514.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6838\u5fc3\u6982\u5ff5&#xff1a;\u94fe (Chain)LangChain4j \u7684\u6838\u5fc3\u601d\u60f3\u662f\u5c06\u590d\u6742\u7684\u4efb\u52a1\u62c6\u89e3\u4e3a\u4e00\u7cfb\u5217\u53ef\u7ec4\u5408\u7684\u6b65\u9aa4&#xff08;\u94fe\u63a5&#xff09;&#xff0c;\u5f62\u6210\u4e00\u4e2a\u201c\u94fe\u201d\u3002\u8fd9\u6709\u52a9\u4e8e\u6a21\u5757\u5316\u3001\u590d\u7528\u548c\u66f4\u6e05\u6670\u7684\u903b\u8f91\u3002\u57fa\u672c\u4f7f\u7528\u6b65\u9aa4\u6dfb\u52a0\u4f9d\u8d56 \u5728\u4f60\u7684 Maven \u6216 Gradle \u9879\u76ee\u4e2d\u5f15\u5165 LangChain4j \u7684\u6838\u5fc3\u5e93\u4ee5\u53ca\u4f60\u8ba1\u5212\u4f7f\u7528\u7684 LLM \u63d0\u4f9b\u5546\u7684\u9002\u914d\u5668\u5e93&#xff08;\u5982 OpenAI, HuggingFace, LocalAI \u7b49&#xff09;\u3002\u4f8b\u5982&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/62514.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-19T21:42:02+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62514.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/62514.html\",\"name\":\"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-19T21:42:02+00:00\",\"dateModified\":\"2026-01-19T21:42:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/62514.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/62514.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62514.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3\"}]},{\"@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":"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \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\/62514.html","og_locale":"zh_CN","og_type":"article","og_title":"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6838\u5fc3\u6982\u5ff5&#xff1a;\u94fe (Chain)LangChain4j \u7684\u6838\u5fc3\u601d\u60f3\u662f\u5c06\u590d\u6742\u7684\u4efb\u52a1\u62c6\u89e3\u4e3a\u4e00\u7cfb\u5217\u53ef\u7ec4\u5408\u7684\u6b65\u9aa4&#xff08;\u94fe\u63a5&#xff09;&#xff0c;\u5f62\u6210\u4e00\u4e2a\u201c\u94fe\u201d\u3002\u8fd9\u6709\u52a9\u4e8e\u6a21\u5757\u5316\u3001\u590d\u7528\u548c\u66f4\u6e05\u6670\u7684\u903b\u8f91\u3002\u57fa\u672c\u4f7f\u7528\u6b65\u9aa4\u6dfb\u52a0\u4f9d\u8d56 \u5728\u4f60\u7684 Maven \u6216 Gradle \u9879\u76ee\u4e2d\u5f15\u5165 LangChain4j \u7684\u6838\u5fc3\u5e93\u4ee5\u53ca\u4f60\u8ba1\u5212\u4f7f\u7528\u7684 LLM \u63d0\u4f9b\u5546\u7684\u9002\u914d\u5668\u5e93&#xff08;\u5982 OpenAI, HuggingFace, LocalAI \u7b49&#xff09;\u3002\u4f8b\u5982&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/62514.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-19T21:42:02+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/62514.html","url":"https:\/\/www.wsisp.com\/helps\/62514.html","name":"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-19T21:42:02+00:00","dateModified":"2026-01-19T21:42:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/62514.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/62514.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/62514.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"LangChain4j\u5165\u95e8\uff1a\u94fe\u5f0fAI\u4efb\u52a1\u62c6\u89e3"}]},{"@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\/62514","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=62514"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/62514\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=62514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=62514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=62514"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=62514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}