Skip to content

Commit 5f2d3f6

Browse files
committed
refactor: promptAsync → chatCompletionAsync,对外方法命名与 OpenClaw/Hermes 统一
- promptAsync → chatCompletionAsync(门面层) - HttpClient 底层 promptAsync 保持不变(私有实现) - 清理 javadoc 中的 prompt 残留引用
1 parent 12705bb commit 5f2d3f6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/io/github/hiwepy/opencode/OpenCodeClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* 三条通信通道相互独立:
1717
* </p>
1818
* <ul>
19-
* <li><b>HTTP</b>:{@link #prompt} / {@link #promptAsync} / {@link #createSession} 等 — REST API</li>
19+
* <li><b>HTTP</b>:{@link #chatCompletion} / {@link #chatCompletionAsync} / {@link #createSession} 等 — REST API</li>
2020
* <li><b>SSE</b>:{@link #sse()} — 事件流</li>
2121
* <li><b>CLI</b>:{@link #cli()} — 本地 {@code opencode} 命令封装</li>
2222
* </ul>
@@ -158,20 +158,20 @@ public String ensureSession(String sessionKey) {
158158
}
159159

160160
/**
161-
* 异步发送 prompt,不等待响应。
161+
* 异步发送消息,不等待响应。
162162
*
163163
* @param sessionId 会话 ID
164164
* @param request prompt 请求
165165
* @return 是否成功提交
166166
*/
167-
public boolean promptAsync(String sessionId, PromptRequest request) {
167+
public boolean chatCompletionAsync(String sessionId, PromptRequest request) {
168168
return httpClient.promptAsync(sessionId, request);
169169
}
170170

171171
/**
172-
* 快捷方式:异步发送纯文本 prompt
172+
* 快捷方式:异步发送纯文本消息
173173
*/
174-
public boolean promptAsync(String sessionId, String text) {
174+
public boolean chatCompletionAsync(String sessionId, String text) {
175175
return httpClient.promptAsync(sessionId, PromptRequest.ofText(text));
176176
}
177177

0 commit comments

Comments
 (0)