Skip to content

Commit c3a9037

Browse files
committed
docs: focus README on SDK setup and shared behavior
1 parent bb6e7bd commit c3a9037

3 files changed

Lines changed: 116 additions & 82 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Move resource-specific README documentation into a dedicated usage guide, keeping the README focused on SDK setup and shared client behavior.
8+
59
### Removed
610

711
- Remove the deprecated Managed `skills().update(...)` API and `managed.SkillUpdateParams` from the 0.2.0 candidate, including asynchronous and `withResponse()` variants. Use `skills().versions().create(...)` for Skill content updates; it does not replace Skill metadata updates. Forward Skill APIs are unchanged.

‎README.md‎

Lines changed: 15 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,17 @@ The Qoder Cloud Agents Java SDK provides typed synchronous and asynchronous clie
66

77
Version **0.2.0** supports both the **Forward API** and the **[Managed API](docs/managed.md)** in one package. Use `ForwardClient` / `AsyncForwardClient` for Forward and `ManagedClient` / `AsyncManagedClient` for Managed.
88

9-
| Capability | Resources |
10-
| --- | --- |
11-
| Agent configuration | Forward Template, Identity and per-Identity configuration; Managed Agent and versions |
12-
| Conversations | Session, Thread, event history and SSE subscriptions |
13-
| Execution | Forward Schedule, Schedule Run, Batch and Batch Task; Managed Deployment, Run and self-hosted Work |
14-
| Resources | Environment, File, Skill, Vault, Memory Store and resource Search; Forward Drive |
15-
| Channels and notifications | Forward Channel configuration, Pairing management, QR authorization and Webhooks |
16-
| Authentication and usage | PAT, Service Account credentials, Forward SAT issuance/revocation, Model and Usage |
17-
| Realtime (Forward, Beta) | Text/audio WebSocket conversations and persisted History |
18-
19-
See the [Forward](docs/forward-api-coverage.md) and [Managed](docs/managed-api-coverage.md) coverage inventories and resource guides for the supported operations.
20-
21-
The [0.2.0 changelog](CHANGELOG.md) covers Forward Search, Dreams, Decisions, pairing management, contract updates, Session creation metadata, Webhooks, client extensions and 107 Managed operations. See the [Forward migration guide](docs/forward-parity.md) for the rubric field and reserved metadata changes.
22-
239
- [Installation](#installation)
2410
- [Quick start](#quick-start)
2511
- [PAT and Service Account authentication](#pat-and-service-account-authentication)
26-
- [Conversations and streaming](#conversations-and-streaming)
12+
- [Streaming](#streaming)
2713
- [Asynchronous calls and cancellation](#asynchronous-calls-and-cancellation)
2814
- [Pagination](#pagination)
2915
- [Timeouts, retries and errors](#timeouts-retries-and-errors)
30-
- [Realtime](#realtime)
31-
- [Examples and documentation](#examples-and-documentation)
16+
- [Documentation and examples](#documentation-and-examples)
3217
- [Development](#development)
18+
- [Versioning](#versioning)
19+
- [License](#license)
3320

3421
## Installation
3522

@@ -50,7 +37,7 @@ Requirements:
5037

5138
## Quick start
5239

53-
Set `QODER_PAT` in your environment. This complete Forward program connects to Global and lists the enabled models. For Managed client creation, authentication and resource examples, see the [Managed quick start](docs/managed.md#client-and-authentication).
40+
Set `QODER_PAT` in your environment. This complete Forward program connects to Global and lists the enabled models. For the other client, see the [Managed quick start](docs/managed.md#client-and-authentication).
5441

5542
```java
5643
import com.qoder.cloudagents.ForwardClient;
@@ -113,53 +100,9 @@ Business requests use the SAT; the SA Key is sent only to the exchange service.
113100

114101
Forward also provides explicit administrator/Identity SAT issuance and revocation through `serviceAccountTokens()` and `identities().serviceAccountTokens()`. These methods take a per-call SA Key and do not retry automatically. See [SAT management](docs/usage-sat-drive.md) and [authentication configuration](docs/client-configuration.md).
115102

116-
## Conversations and streaming
103+
## Streaming
117104

118-
Create a Session using an existing Identity and Template, send a user message, and consume events through SSE:
119-
120-
```java
121-
import com.qoder.cloudagents.core.RequestOptions;
122-
import com.qoder.cloudagents.forward.*;
123-
import com.qoder.cloudagents.streaming.EventStream;
124-
import java.time.Duration;
125-
import java.util.Collections;
126-
import java.util.UUID;
127-
128-
Session session = client.sessions().create(
129-
SessionCreateParams.builder()
130-
.identityId("idn_example")
131-
.templateId("tmpl_example")
132-
.title("SDK quick start")
133-
.build(),
134-
RequestOptions.builder().idempotencyKey(UUID.randomUUID().toString()).build());
135-
136-
SessionEventSendResponse sent = client.sessions().events().send(session.id(),
137-
SessionEventSendParams.builder().events(Collections.singletonList(
138-
SessionEventParam.builder()
139-
.type("user.message")
140-
.content(EventContent.text("Hello!"))
141-
.build())).build(),
142-
RequestOptions.builder().idempotencyKey(UUID.randomUUID().toString()).build());
143-
144-
// Start after the accepted input, excluding events from earlier turns.
145-
String inputEventId = sent.data().get(0).id();
146-
try (EventStream<SessionEvent> stream = client.sessions().events().streamEvents(
147-
session.id(), SessionEventStreamParams.builder().lastEventId(inputEventId).build(),
148-
RequestOptions.builder().totalTimeout(Duration.ofMinutes(5)).build())) {
149-
for (SessionEvent event : stream) {
150-
System.out.println(event.type());
151-
// Inspect event.content() for message blocks.
152-
if ("session.error".equals(event.type()) || "session.status_terminated".equals(event.type())) {
153-
throw new IllegalStateException("Session stopped: " + event.type());
154-
}
155-
if ("session.status_idle".equals(event.type())) break;
156-
}
157-
}
158-
```
159-
160-
Reuse an idempotency key when retrying the same logical write. A successful send acknowledges input, not completed execution. An idle event can mean the turn finished or paused for input; inspect the event's stop reason in your application. The example bounds the subscription to five minutes; closing it does not cancel or archive the Session.
161-
162-
Thread subscriptions use `sessions().threads().events()`. For explicit reconnects with the last delivered SSE ID, use `resumableStream(...)`; user messages are not automatically resent. See [Session operations](docs/sessions.md), [streaming and cancellation](docs/session-streaming.md) and the [runnable streaming example](examples/src/main/java/com/qoder/cloudagents/examples/SessionStreamingExample.java).
105+
Streaming responses are consumed incrementally. Close the stream when finished and handle interruption explicitly; closing a local stream does not cancel server-side work. See the [usage guide](docs/usage-guide.md) for runnable patterns and reconnection behavior.
163106

164107
## Asynchronous calls and cancellation
165108

@@ -190,7 +133,7 @@ for (com.qoder.cloudagents.forward.Template template : page) {
190133
}
191134
```
192135

193-
Use `page.data()` for only the current page, or `hasNextPage()` and `getNextPage()` / `getNextPageAsync()` for manual pagination. Filters, request options and server order are preserved. Drive uses `entries` / `next_page_token`; Realtime History has its own `next_before` cursor. See the [resource guides](docs/forward-api-coverage.md#使用指南) for those APIs.
136+
Use `page.data()` for only the current page, or `hasNextPage()` and `getNextPage()` / `getNextPageAsync()` for manual pagination. Filters, request options and server order are preserved. See the [usage guide](docs/usage-guide.md#pagination) for API-specific pagination behavior.
194137

195138
## Timeouts, retries and errors
196139

@@ -219,20 +162,14 @@ try {
219162

220163
See [client configuration](docs/client-configuration.md) for detailed defaults and [Template configuration](docs/templates.md) for typed configuration and field semantics.
221164

222-
## Realtime
223-
224-
Realtime (Beta) supports conversation creation, text and PCM audio exchange over WebSocket, Work events and persisted History. Use `client.realtime().conversations()` for creation/history and `client.realtime().connect(...)` for connections. The Template must have Realtime enabled and be accessible to the credential.
165+
## Documentation and examples
225166

226-
Microphone capture and audio playback belong to the application. Connections do not automatically reconnect or replay input. See the [Realtime guide](docs/realtime.md) and [runnable example](examples/src/main/java/com/qoder/cloudagents/examples/RealtimeExample.java) for authentication, audio formats and connection lifecycle.
227-
228-
## Examples and documentation
229-
230-
- [Runnable examples](examples/README.md): shared PAT/SA setup, resource lifecycles, Session SSE and Realtime.
231-
- [API coverage](docs/forward-api-coverage.md): supported operations and guides for each resource.
232-
- [Managed API](docs/managed.md): Agents, Deployments, Sessions, resources and self-hosted Work.
233-
- [Client extensions](docs/client-configuration.md#client-extensions): custom HTTP transport, interceptors, generic JSON requests and configuration copies.
234-
- [Files and downloads](docs/environments-files.md) and [Drive, Usage and SAT management](docs/usage-sat-drive.md).
235-
- [Live testing](docs/live-testing.md): opt-in CN/Global verification and coverage boundaries.
167+
- [Usage guide](docs/usage-guide.md)
168+
- [Forward API reference](docs/forward-api-coverage.md)
169+
- [Managed API reference](docs/managed-api-coverage.md)
170+
- [Client configuration](docs/client-configuration.md)
171+
- [Runnable examples](examples/README.md)
172+
- [Contribution guide](CONTRIBUTING.md)
236173

237174
## Development
238175

@@ -252,7 +189,3 @@ Pin the SDK version in your build. Before 1.0, incompatible API changes use a ne
252189
## License
253190

254191
[MIT](LICENSE).
255-
256-
## Forward Webhooks (next release)
257-
258-
Manage webhook endpoints and verify signed event deliveries. See [Webhook usage and receiver examples](docs/webhooks.md).

‎docs/usage-guide.md‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Usage guide
2+
3+
Resource-specific behavior and examples for the Qoder Cloud Agents SDK. See the [README](../README.md) for installation, authentication and shared client configuration. Run shell commands from the repository root; code fragments use the clients and imports shown in the README unless stated otherwise.
4+
5+
- [API coverage](#api-coverage)
6+
- [Conversations and streaming](#conversations-and-streaming)
7+
- [Realtime](#realtime)
8+
- [Forward Webhooks (next release)](#forward-webhooks-next-release)
9+
- [Pagination](#pagination)
10+
- [Further reading](#further-reading)
11+
12+
## API coverage
13+
14+
| Capability | Resources |
15+
| --- | --- |
16+
| Agent configuration | Forward Template, Identity and per-Identity configuration; Managed Agent and versions |
17+
| Conversations | Session, Thread, event history and SSE subscriptions |
18+
| Execution | Forward Schedule, Schedule Run, Batch and Batch Task; Managed Deployment, Run and self-hosted Work |
19+
| Resources | Environment, File, Skill, Vault, Memory Store and resource Search; Forward Drive |
20+
| Channels and notifications | Forward Channel configuration, Pairing management, QR authorization and Webhooks |
21+
| Authentication and usage | PAT, Service Account credentials, Forward SAT issuance/revocation, Model and Usage |
22+
| Realtime (Forward, Beta) | Text/audio WebSocket conversations and persisted History |
23+
24+
See the [Forward](../docs/forward-api-coverage.md) and [Managed](../docs/managed-api-coverage.md) coverage inventories and resource guides for the supported operations.
25+
26+
The [0.2.0 changelog](../CHANGELOG.md) covers Forward Search, Dreams, Decisions, pairing management, contract updates, Session creation metadata, Webhooks, client extensions and 107 Managed operations. See the [Forward migration guide](../docs/forward-parity.md) for the rubric field and reserved metadata changes.
27+
28+
## Conversations and streaming
29+
30+
Create a Session using an existing Identity and Template, send a user message, and consume events through SSE:
31+
32+
```java
33+
import com.qoder.cloudagents.core.RequestOptions;
34+
import com.qoder.cloudagents.forward.*;
35+
import com.qoder.cloudagents.streaming.EventStream;
36+
import java.time.Duration;
37+
import java.util.Collections;
38+
import java.util.UUID;
39+
40+
Session session = client.sessions().create(
41+
SessionCreateParams.builder()
42+
.identityId("idn_example")
43+
.templateId("tmpl_example")
44+
.title("SDK quick start")
45+
.build(),
46+
RequestOptions.builder().idempotencyKey(UUID.randomUUID().toString()).build());
47+
48+
SessionEventSendResponse sent = client.sessions().events().send(session.id(),
49+
SessionEventSendParams.builder().events(Collections.singletonList(
50+
SessionEventParam.builder()
51+
.type("user.message")
52+
.content(EventContent.text("Hello!"))
53+
.build())).build(),
54+
RequestOptions.builder().idempotencyKey(UUID.randomUUID().toString()).build());
55+
56+
// Start after the accepted input, excluding events from earlier turns.
57+
String inputEventId = sent.data().get(0).id();
58+
try (EventStream<SessionEvent> stream = client.sessions().events().streamEvents(
59+
session.id(), SessionEventStreamParams.builder().lastEventId(inputEventId).build(),
60+
RequestOptions.builder().totalTimeout(Duration.ofMinutes(5)).build())) {
61+
for (SessionEvent event : stream) {
62+
System.out.println(event.type());
63+
// Inspect event.content() for message blocks.
64+
if ("session.error".equals(event.type()) || "session.status_terminated".equals(event.type())) {
65+
throw new IllegalStateException("Session stopped: " + event.type());
66+
}
67+
if ("session.status_idle".equals(event.type())) break;
68+
}
69+
}
70+
```
71+
72+
Reuse an idempotency key when retrying the same logical write. A successful send acknowledges input, not completed execution. An idle event can mean the turn finished or paused for input; inspect the event's stop reason in your application. The example bounds the subscription to five minutes; closing it does not cancel or archive the Session.
73+
74+
Thread subscriptions use `sessions().threads().events()`. For explicit reconnects with the last delivered SSE ID, use `resumableStream(...)`; user messages are not automatically resent. See [Session operations](../docs/sessions.md), [streaming and cancellation](../docs/session-streaming.md) and the [runnable streaming example](../examples/src/main/java/com/qoder/cloudagents/examples/SessionStreamingExample.java).
75+
76+
## Realtime
77+
78+
Realtime (Beta) supports conversation creation, text and PCM audio exchange over WebSocket, Work events and persisted History. Use `client.realtime().conversations()` for creation/history and `client.realtime().connect(...)` for connections. The Template must have Realtime enabled and be accessible to the credential.
79+
80+
Microphone capture and audio playback belong to the application. Connections do not automatically reconnect or replay input. See the [Realtime guide](../docs/realtime.md) and [runnable example](../examples/src/main/java/com/qoder/cloudagents/examples/RealtimeExample.java) for authentication, audio formats and connection lifecycle.
81+
82+
## Forward Webhooks (next release)
83+
84+
Manage webhook endpoints and verify signed event deliveries. See [Webhook usage and receiver examples](../docs/webhooks.md).
85+
86+
## Pagination
87+
88+
Drive uses `entries` / `next_page_token`; Realtime History has its own `next_before` cursor. See the [resource guides](forward-api-coverage.md#使用指南) for those APIs.
89+
90+
## Further reading
91+
92+
- [Runnable examples](../examples/README.md): shared PAT/SA setup, resource lifecycles, Session SSE and Realtime.
93+
- [API coverage](../docs/forward-api-coverage.md): supported operations and guides for each resource.
94+
- [Managed API](../docs/managed.md): Agents, Deployments, Sessions, resources and self-hosted Work.
95+
- [Client extensions](../docs/client-configuration.md#client-extensions): custom HTTP transport, interceptors, generic JSON requests and configuration copies.
96+
- [Files and downloads](../docs/environments-files.md) and [Drive, Usage and SAT management](../docs/usage-sat-drive.md).
97+
- [Live testing](../docs/live-testing.md): opt-in CN/Global verification and coverage boundaries.

0 commit comments

Comments
 (0)