@serenity-star/sdk 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-star/sdk",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "The Serenity Star JavaScript SDK provides a convenient way to interact with the Serenity Star API, enabling you to build custom applications.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/readme.md CHANGED
@@ -12,6 +12,7 @@ The Serenity Star JS/TS SDK provides a comprehensive interface for interacting w
12
12
  - [Assistants / Copilots](#assistants--copilots)
13
13
  - [Start a new conversation with an Agent](#start-a-new-conversation-with-an-agent)
14
14
  - [Get conversation information](#get-conversation-information)
15
+ - [Use channel-pinned agent version](#use-channel-pinned-agent-version)
15
16
  - [Get conversation by id](#get-conversation-by-id)
16
17
  - [Sending messages within a conversation](#sending-messages-within-a-conversation)
17
18
  - [Stream message with SSE](#stream-message-with-sse)
@@ -114,6 +115,31 @@ console.log(
114
115
  );
115
116
  ```
116
117
 
118
+ ## Use channel-pinned agent version
119
+
120
+ By default, when no `agentVersion` is specified, the SDK executes the **latest** version of the agent. If your application uses channels that pin a specific agent version, you can opt in to that behavior with `useChannelVersion`:
121
+
122
+ ```tsx
123
+ import SerenityClient from '@serenity-star/sdk';
124
+
125
+ const client = new SerenityClient({
126
+ apiKey: '<SERENITY_API_KEY>',
127
+ });
128
+
129
+ // Opt in to using the version defined in the channel configuration
130
+ const conversation = await client.agents.assistants.createConversation("chef-assistant", {
131
+ channel: "my-channel",
132
+ useChannelVersion: true,
133
+ });
134
+
135
+ // The conversation now targets the agent version pinned by the channel.
136
+ // If the channel pins version 3, all messages will execute against version 3.
137
+ const response = await conversation.sendMessage("Hello!");
138
+ console.log(response.content);
139
+ ```
140
+
141
+ > **Note:** An explicit `agentVersion` always takes priority over the channel's target version. When `useChannelVersion` is `false` (the default), the channel metadata is still available in `conversation.info` but does not affect which agent version is executed.
142
+
117
143
  ## Get conversation by id
118
144
 
119
145
  ```tsx