| Package | Description |
|---|---|
| io.github.easy4j.opencode | |
| io.github.easy4j.opencode.api |
| Modifier and Type | Method and Description |
|---|---|
ChatResponse |
OpenCodeClient.chatCompletionWithSession(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
PromptResult |
OpenCodeClient.chatCompletionWithSession(PromptRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
CompletableFuture<ChatResponse> |
OpenCodeClient.chatCompletionWithSessionAsync(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
异步查找会话并完成聊天请求。
|
| Modifier and Type | Method and Description |
|---|---|
ChatResponse |
OpenCodeChatClient.chatCompletionWithSession(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
PromptResult |
OpenCodeHttpClient.chatCompletionWithSession(PromptRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
CompletableFuture<ChatResponse> |
OpenCodeChatClient.chatCompletionWithSessionAsync(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
异步查找会话并完成聊天请求。
|
Session |
OpenCodeHttpClient.createSession(String title,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
通过 OpenCode Server HTTP API 创建会话。
|
CompletableFuture<Session> |
OpenCodeHttpClient.createSessionAsync(String title,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
异步请求 OpenCode Server 创建会话;网络或解析失败通过返回的 Future 传播。
|
String |
OpenCodeHttpClient.ensureSession(String sessionKey,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
查找稳定会话键对应的会话;不存在时创建新会话。
|
CompletableFuture<String> |
OpenCodeHttpClient.ensureSessionAsync(String sessionKey,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
异步查找或创建会话。
|
protected <T> CompletableFuture<T> |
OpenCodeHttpClient.executeAsync(okhttp3.Request request,
Class<T> type,
HttpCallCancellation cancellation)
使用 OkHttp enqueue 异步执行并反序列化对象。
|
Optional<Session> |
OpenCodeHttpClient.findSessionByTitle(String title,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
调用 OpenCode Server 搜索接口查找标题匹配的会话;未命中时返回空结果。
|
CompletableFuture<List<Session>> |
OpenCodeHttpClient.listSessionsAsync(String search,
Integer limit,
Integer start,
OpenCodeRequestContext context,
HttpCallCancellation cancellation)
异步分页列出会话。
|
PromptResult |
OpenCodeHttpClient.prompt(String sessionId,
PromptRequest request,
HttpCallCancellation cancellation)
向指定会话同步提交 Prompt,并等待 OpenCode Server 返回完整生成结果。
|
CompletableFuture<PromptResult> |
OpenCodeHttpClient.promptCompletionAsync(String sessionId,
PromptRequest request,
HttpCallCancellation cancellation)
异步发送消息并等待完整 Prompt 结果。
|
Copyright © 2026. All rights reserved.