| Package | Description |
|---|---|
| io.github.easy4j.opencode | |
| io.github.easy4j.opencode.api | |
| io.github.easy4j.opencode.api.mapper | |
| io.github.easy4j.opencode.api.model |
| Modifier and Type | Method and Description |
|---|---|
ChatResponse |
OpenCodeClient.chatCompletion(String sessionId,
ChatRequest request)
同步提交聊天请求并返回完整响应。
|
CompletableFuture<ChatResponse> |
OpenCodeClient.chatCompletionAsync(String sessionId,
ChatRequest request)
异步完成指定会话的聊天请求。
|
StreamingChatResponse |
OpenCodeClient.chatCompletionStream(ChatRequest request,
String sessionKey)
创建流式聊天响应,异步订阅会话事件并持续交付文本增量。
|
StreamingChatResponse |
OpenCodeClient.chatCompletionStream(ChatRequest request,
String sessionKey,
OpenCodeRequestContext context)
创建流式聊天响应,异步订阅会话事件并持续交付文本增量。
|
StreamingChatResponse |
OpenCodeClient.chatCompletionStream(ChatRequest request,
String sessionKey,
OpenCodeRequestContext context,
Consumer<String> deltaConsumer)
流式对话,并在订阅启动前绑定增量回调,避免丢失首批分片。
|
ChatResponse |
OpenCodeClient.chatCompletionWithSession(ChatRequest request,
String sessionKey)
复用或创建稳定会话后提交聊天请求并返回结果。
|
ChatResponse |
OpenCodeClient.chatCompletionWithSession(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
CompletableFuture<ChatResponse> |
OpenCodeClient.chatCompletionWithSessionAsync(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
异步查找会话并完成聊天请求。
|
| Modifier and Type | Method and Description |
|---|---|
ChatResponse |
OpenCodeChatClient.chatCompletion(String sessionId,
ChatRequest request)
同步提交聊天请求并返回完整响应。
|
CompletableFuture<ChatResponse> |
OpenCodeChatClient.chatCompletionAsync(String sessionId,
ChatRequest request)
异步完成指定会话的聊天请求。
|
StreamingChatResponse |
OpenCodeChatClient.chatCompletionStream(ChatRequest request,
String sessionKey)
创建流式聊天响应,异步订阅会话事件并持续交付文本增量。
|
StreamingChatResponse |
OpenCodeChatClient.chatCompletionStream(ChatRequest request,
String sessionKey,
OpenCodeRequestContext context)
创建流式聊天响应,异步订阅会话事件并持续交付文本增量。
|
StreamingChatResponse |
OpenCodeChatClient.chatCompletionStream(ChatRequest request,
String sessionKey,
OpenCodeRequestContext context,
Consumer<String> deltaConsumer)
在事件订阅启动前绑定增量回调,避免丢失首批分片。
|
ChatResponse |
OpenCodeChatClient.chatCompletionWithSession(ChatRequest request,
String sessionKey)
复用或创建稳定会话后提交聊天请求并返回结果。
|
ChatResponse |
OpenCodeChatClient.chatCompletionWithSession(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
复用或创建稳定会话后提交聊天请求并返回结果。
|
CompletableFuture<ChatResponse> |
OpenCodeChatClient.chatCompletionWithSessionAsync(ChatRequest request,
String sessionKey,
HttpCallCancellation cancellation)
异步查找会话并完成聊天请求。
|
| Modifier and Type | Method and Description |
|---|---|
static PromptRequest |
ChatMessageMapper.toPromptRequest(ChatRequest chatRequest)
ChatRequest → PromptRequest。
|
| Modifier and Type | Method and Description |
|---|---|
static ChatRequest |
ChatRequest.ofUser(String content)
快捷构造:单条 user 消息。
|
static ChatRequest |
ChatRequest.ofUser(String content,
String model)
快捷构造:单条 user 消息 + 模型。
|
Copyright © 2026. All rights reserved.