Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Flux<String> streamText(String prompt) {
.permissionMode(PermissionMode.BYPASS_PERMISSIONS)
.build();

return client.queryAndReceive(prompt)
return client.connect(prompt).messages()
.doOnSubscribe(s -> log.info("[STREAM] Subscribed to ClaudeAsyncClient"))
.doOnNext(msg -> log.debug("[STREAM] Message: {}", msg.getClass().getSimpleName()))
.filter(msg -> msg instanceof AssistantMessage)
Expand Down
2 changes: 1 addition & 1 deletion examples/excel-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Flux<String> streamText(String prompt) {
.permissionMode(PermissionMode.BYPASS_PERMISSIONS)
.build();

return client.queryAndReceive(prompt)
return client.connect(prompt).messages()
.filter(msg -> msg instanceof AssistantMessage)
.flatMap(msg -> ((AssistantMessage) msg).getTextContent()
.map(Mono::just).orElse(Mono.empty()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Flux<String> streamText(String prompt, Path workingDirectory) {
.permissionMode(PermissionMode.BYPASS_PERMISSIONS)
.build();

return client.queryAndReceive(prompt)
return client.connect(prompt).messages()
.doOnSubscribe(s -> log.info("[STREAM] Subscribed to ClaudeAsyncClient"))
.doOnNext(msg -> log.info("[STREAM] Message received: type={}", msg.getClass().getSimpleName()))
.filter(msg -> msg instanceof AssistantMessage)
Expand Down Expand Up @@ -139,7 +139,7 @@ public Flux<Message> streamMessages(String prompt) {
.permissionMode(PermissionMode.BYPASS_PERMISSIONS)
.build();

return client.queryAndReceive(prompt)
return client.connect(prompt).messages()
.doFinally(signal -> client.close().subscribe());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static void main(String[] args) {
.build();

asyncClient.connect("Explain recursion in 2 sentences.")
.messages()
.thenMany(asyncClient.receiveResponse())
.filter(msg -> msg instanceof AssistantMessage)
.flatMap(msg -> ((AssistantMessage) msg).getTextContent().map(reactor.core.publisher.Mono::just)
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<inherited>false</inherited>
<executions>
<execution>
<id>generate-sources</id>
Expand Down