Skip to content

Commit 33e3471

Browse files
committed
docs:update
1 parent ebf199b commit 33e3471

File tree

12 files changed

+2016
-6
lines changed

12 files changed

+2016
-6
lines changed

docs/.vuepress/config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ module.exports = {
155155
text: '设计模式',
156156
items: [{
157157
text: '模板方法设计模式(Template Pattern)',
158-
link: '/md/design/模板方法设计模式(Template Pattern).md'
158+
link: '/md/design/template-pattern'
159159
},]
160160
},
161161
{
@@ -1244,6 +1244,7 @@ module.exports = {
12441244
"JDK21新特性",
12451245
"JDK22新特性",
12461246
"JDK23新特性",
1247+
"java24-new-features",
12471248
"java2024",
12481249
]
12491250
},
@@ -2117,6 +2118,7 @@ module.exports = {
21172118
"chatgpt-canva",
21182119
"llm-reasoning-limitations",
21192120
"making-an-llm-that-sees-and-reasons",
2121+
"lmstudio-local-llm-call",
21202122
]
21212123
},
21222124
{
@@ -2247,7 +2249,10 @@ module.exports = {
22472249
"ai-services",
22482250
"tools",
22492251
"rag",
2252+
"structured-outputs",
22502253
"observability",
2254+
"customizable-http-client",
2255+
"mcp",
22512256
]
22522257
},
22532258

@@ -2271,6 +2276,7 @@ module.exports = {
22712276
children: [
22722277
"changelog-cursor",
22732278
"goodbye-cursor-hello-windsurf",
2279+
"Junie",
22742280
]
22752281
},
22762282
],
@@ -2282,6 +2288,7 @@ module.exports = {
22822288
children: [
22832289
"mcp-fad-or-fixture",
22842290
"mcp-and-the-future-of-ai-tooling",
2291+
"mcp-java-sdk",
22852292
]
22862293
},
22872294
{
@@ -2440,12 +2447,13 @@ module.exports = {
24402447
sidebarDepth: 0,
24412448
children: [
24422449
"【Java设计模式实战】单例模式",
2443-
"模板方法设计模式(Template Pattern)",
2444-
"策略模式Strategy Pattern",
2450+
"template-pattern",
2451+
"strategy-pattern",
24452452
"建造者模式",
2446-
"代理模式Proxy Pattern",
2453+
"proxy-pattern",
24472454
"适配器模式",
24482455
"门面模式",
2456+
"iterator-pattern",
24492457
]
24502458
},
24512459
],

docs/md/AI/agent/Junie.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# 对标cursor,JetBrains官方推出Junie!
2+
3+
![](https://blog.jetbrains.com/wp-content/uploads/2025/01/Blog_1280x720.png)
4+
5+
## 0 前言
6+
7+
Junie 能根据开发者在 IDE 中提供的项目上下文信息,执行所分配的编码任务。
8+
9+
可让 Junie “实现用于管理书签的增删改查操作,并带有用户界面”。Junie 会收集所有相关的上下文信息,然后规划出完成任务的各个步骤,包括分析项目结构、检查依赖项、确认是否存在需要通过的测试、创建所需的源文件、运行测试等。
10+
11+
![](https://imgopt.infoq.com/fit-in/3000x4000/filters:quality(85)/filters:no_upscale()/news/2025/01/jetbrains-junie-agent/en/resources/1jetbrains-junie-1738338914161.jpg)
12+
13+
任务完成后,Junie 会指出当前方案可能存在的已知限制,用户可以进行查看、修改,最终决定是否接受。Junie 还能为现有程序编写测试用例、运行代码检查等。
14+
15+
## 1 基准测试
16+
17+
![](https://blog.jetbrains.com/wp-content/uploads/2025/01/Blog_body_1280x604.png)
18+
19+
Junie 在 [SWEBench Verified 基准测试](https://www.swebench.com/#verified) 中完成 53.6% 任务,该测试涵盖 500 多个编程任务。
20+
21+
根据 SWEBench Verified —— 一个涵盖 500 个开发任务的权威基准测试,Junie 在单次运行中可完成 53.6% 的任务。这一成绩展示了它强大的潜力,也证明了 Junie 能适应现代软件开发中各种复杂程度不同的任务,为全球数百万开发者和企业解锁 AI 编码代理的力量。
22+
23+
## 2 AI 编码代理 V.S AI 编码助手
24+
25+
AI 编码代理可以看作是 AI 编码助手的进化版:
26+
27+
- 后者主要是在编辑器中根据用户提示提供代码补全或重构建议,比如根据方法签名或注释建议实现方式、生成文档等
28+
- 而 AI 代理则更强调自主完成整个任务,从“辅助开发者”向“与开发者协作”的模式转变
29+
30+
已有许多大厂和初创公司加入这一领域,如:
31+
32+
- AWS 最近为其 [Q Developer](https://www.infoq.com/news/2024/12/new-amazon-q-developer-agent/) 助手增加代理功能
33+
- Google 发布基于 Gemini 2.0 的 [Jules 代理](https://www.infoq.com/news/2024/12/google-jules-agent/)
34+
- GitHub 推出基于 GPT-4 Turbo 的 [Copilot Workspace](https://www.infoq.com/news/2024/05/github-copilot-workspace-preview/)
35+
- 许多表现突出的代理工具跻身 SWEBench Verified 排行榜前十,如 [W&B Programmer O1 crosscheck5](https://wandb.ai/)[Blackbox AI Agent](https://www.blackbox.ai/)[CodeStory Midwit Agent + swe-search](https://aide.dev/)[Emergent.ai](https://emergent.sh/)
36+
37+
JetBrains 2023 年就推出[AI Assistant](https://www.infoq.com/news/2023/12/jetbrains-ai-assistant-ga/),但市场反馈褒贬不一,[有开发者称其功能强大,也有人提出批评](https://plugins.jetbrains.com/plugin/22282-jetbrains-ai-assistant/reviews)。目前市场上还有其他编码助手可选,如 [GitHub Copilot](https://www.infoq.com/news/2024/12/github-copilot-free-vscode/)[Google Code Assist](https://www.infoq.com/news/2025/01/gemini-code-assist-tools/)[AWS CodeWhisperer](https://www.infoq.com/news/2022/07/aws-codewhisperer-coding/)
38+
39+
## 3 JetBrains使命
40+
41+
推动新一代技术的发展,让软件开发变得更高效、更有趣。为了赋能开发者,我们打造了众多专业开发工具,包括强大的 AI 功能,已经显著提升了开发效率,并为创意打开了新的可能。那么,我们能否更进一步:提升代码质量、激发创新、完成复杂任务、彻底改变编程方式?
42+
43+
答案是:**当然可以!**
44+
45+
随着 Junie 的推出,JetBrains 正在重新定义编码方式。借助 Junie 的“代理智能”能力,你可以在 IDE 中将繁琐的任务完全交由它处理,也可以与它协作完成复杂任务。得益于 JetBrains IDE 的强大能力与可靠的大型语言模型(LLM),Junie 能解决原本需要几个小时的工作。
46+
47+
<iframe title="See Junie in Action: Your Coding Agent in IntelliJ IDEA, a JetBrains IDE" width="500" height="281" src="https://www.youtube.com/embed/ufPGsZtqrac?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" style="box-sizing: inherit; max-height: 100%; max-width: 100%; top: 0px; left: 0px; width: 849px; height: 477.138px;"></iframe>
48+
49+
## 4 重塑开发者体验
50+
51+
### 4.1 无缝集成到你熟悉IDE
52+
53+
Junie不会打乱你的工作节奏,而是帮助你更高效地创造与实现。只需在 IDE 中安装 Junie,即可开始使用。你可以先将简单任务交给它处理,逐步适应这种协作方式,无需改变现有的开发流程。
54+
55+
等你熟悉之后,可以让 Junie 处理更复杂的任务,融入团队协作流程,重新定义任务分配方式,从而提升生产效率,激发创造力,释放 AI 编码代理带来的全新开发体验。
56+
57+
<iframe title="Meet Junie: Your Coding Agent in PyCharm, a JetBrains IDE" width="500" height="281" src="https://www.youtube.com/embed/wpz_0MgNZ5w?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" style="box-sizing: inherit; max-height: 100%; max-width: 100%; top: 0px; left: 0px; width: 849px; height: 477.138px;"></iframe>
58+
59+
### 4.2 始终掌控你的代码
60+
61+
开发者可以快速查看 Junie 提出的更改、保持对项目上下文的把握,并主导关键决策。即使将任务交给 Junie,你也始终掌握主导权,可以审阅代码更动以及它执行命令的方式。
62+
63+
### 4.3 提升代码质量
64+
65+
AI 生成的代码同样可能存在缺陷。Junie 的目标不仅是加快开发速度,更是提升代码质量标准。借助 JetBrains IDE 与 LLM 的结合,Junie 能生成代码、运行检查、编写测试并验证测试是否通过。
66+
67+
### 4.4 让 Junie 成为值得信赖的队友
68+
69+
Junie 设计上能够理解每个项目的上下文,也能适应你的编程风格。它还能遵循特定的编码规范,让 Junie 更好地与你的工作方式保持一致。这不仅提升了代码质量,也让 Junie 在执行任务时更可靠,成为你团队中值得信赖的协作伙伴。
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# HTTP 客户端
2+
3+
>LangChain4j HTTP 客户端定制:解锁 LLM API 交互的更多可能性
4+
5+
## 0 前言
6+
7+
一些 LangChain4j 模块(目前是 OpenAI 和 Ollama)支持自定义用于调用 LLM 提供程序 API 的 HTTP 客户端。
8+
9+
`langchain4j-http-client` 模块实现了一个 `HttpClient` SPI,这些模块用它来调用 LLM 提供程序的 REST API。即底层 HTTP 客户端可自定义,并通过实现 `HttpClient` SPI 来集成任何其他 HTTP 客户端。
10+
11+
## 1 实现方案
12+
13+
目前,有两种开箱即用的实现:
14+
15+
### 1.1 JdkHttpClient
16+
17+
`langchain4j-http-client-jdk` 模块中的 `JdkHttpClient` 。当使用受支持的模块(如 `langchain4j-open-ai` )时,默认使用它。
18+
19+
### 1.2 SpringRestClient
20+
21+
`langchain4j-http-client-spring-restclient` 中的 `SpringRestClient` 。当使用受支持的模块的 Spring Boot 启动器(例如 `langchain4j-open-ai-spring-boot-starter` )时,默认使用它。
22+
23+
## 2 自定义JDK的HttpClient
24+
25+
```java
26+
HttpClient.Builder httpClientBuilder = HttpClient.newBuilder()
27+
.sslContext(...);
28+
29+
JdkHttpClientBuilder jdkHttpClientBuilder = JdkHttpClient.builder()
30+
.httpClientBuilder(httpClientBuilder);
31+
32+
OpenAiChatModel model = OpenAiChatModel.builder()
33+
.httpClientBuilder(jdkHttpClientBuilder)
34+
.apiKey(System.getenv("OPENAI_API_KEY"))
35+
.modelName("gpt-4o-mini")
36+
.build();
37+
```
38+
39+
## 3 定制 Spring 的RestClient
40+
41+
```java
42+
RestClient.Builder restClientBuilder = RestClient.builder()
43+
.requestFactory(new HttpComponentsClientHttpRequestFactory());
44+
45+
SpringRestClientBuilder springRestClientBuilder = SpringRestClient.builder()
46+
.restClientBuilder(restClientBuilder)
47+
.streamingRequestExecutor(new VirtualThreadTaskExecutor());
48+
49+
OpenAiChatModel model = OpenAiChatModel.builder()
50+
.httpClientBuilder(springRestClientBuilder)
51+
.apiKey(System.getenv("OPENAI_API_KEY"))
52+
.modelName("gpt-4o-mini")
53+
.build();
54+
```

0 commit comments

Comments
 (0)