Skip to content

Commit edfdeb2

Browse files
Release - 4.19.0
1 parent be67b6a commit edfdeb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+611
-43
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## v4.19.0 (Jun 05, 2025)
4+
### **Features**
5+
6+
#### AI Agent support is now available natively in the Chat SDK 🎉
7+
You can now enhance your chat with smart AI-driven interactions without separate integration.
8+
Includes conversation list, message templates, CSAT, agent handoff, and more — fully embedded in the SDK.
9+
10+
- **AIAgentModule**
11+
- Added `requestMessengerSettings(params: MessengerSettingsParams)`: Fetch settings such as startup options and UI preferences for the AI agent.
12+
- Added `createConversationListQuery(params: ConversationListQueryParams)`: Create a query to retrieve the user's AI agent conversation list.
13+
- Added `getMessageTemplates(params: AIAgentMessageTemplateListParams)`: Fetch a list of available AI message templates for UI rendering.
14+
15+
- **GroupChannel**
16+
- Added `submitCSAT(params: CSATSubmitParams)`: Submit a CSAT (Customer Satisfaction) rating for a conversation.
17+
- Added `markConversationAsHandoff()`: Mark a conversation as handed off to a human agent.
18+
19+
- **Etc**
20+
- Added `AI_AGENT` enum value in `SendbirdProduct` for analytics.
21+
322
## v4.18.1 (May 28, 2025)
423
### **Improvement**
524
- Added `metadataKey`, `metadataValues`, `metadataValueStartsWith` in `GroupChannelFilter`

aiAgent.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export {
2+
AIAgentInfo,
3+
AIAgentMessageTemplateListParams,
4+
AIAgentMessageTemplateListResult,
5+
AIAgentModule,
6+
Conversation,
7+
ConversationChannelInfo,
8+
ConversationHandoff,
9+
ConversationListOrder,
10+
ConversationListQuery,
11+
ConversationListQueryParams,
12+
ConversationResolution,
13+
ConversationStatus,
14+
ConversationType,
15+
MessageTemplate,
16+
MessengerSettingsParams,
17+
} from './lib/__definition.js';

aiAgent.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cjs/aiAgent.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./lib/__bundle-a6c826ee.cjs"),t=require("./lib/__bundle-a7cea5ad.cjs");class s extends e.APIRequestCommand{constructor({aiAgentId:t,userId:s,language:n,country:r,context:i,forceCreateChannel:o}){super(),this.method=e.APIRequestMethod.POST,this.path=`${e.API_PATH_AI_AGENT}/ai_agents/${encodeURIComponent(t)}/messenger_settings`,this.requireAuth=!1,this.params=e.deundefined({user_id:s,country:r,language:n,context:i,force_create:o})}}class n extends e.APIResponseCommand{constructor(e,t){super(e,t),this.settings=t}}class r extends e.APIRequestCommand{constructor(t){const{token:s,limit:n,aiAgentId:r,status:i,reverse:o,order:a}=t;super(),this.method=e.APIRequestMethod.GET,this.path=`${e.API_PATH_AI_AGENT}/my_conversations`,this.params=e.deundefined({token:s,limit:n,reverse:o,order:a,status:i,bot_userid:r})}}class i extends e.APIResponseCommand{constructor(e,s){super(e,s),this.conversations=[];const{next_token:n,conversations:r}=s;this.token=n,r&&r.length>0&&(this.conversations=r.map((e=>new t.Conversation(e))))}}const o={limit:10};class a extends e.APIRequestCommand{constructor(t){const{limit:s=o.limit,keys:n,token:r}=t;super(),this.method=e.APIRequestMethod.GET,this.path=`${e.API_PATH_AI_AGENT}/sdk_message_templates`,this.params=e.deundefined({limit:s,keys:n,token:r})}}class u extends e.APIResponseCommand{constructor(e,t){super(e,t);const{templates:s,template_list_token:n}=t;this.token=n,this.templates=s.map((e=>({template:JSON.stringify(e)})))}}class d extends e.APIRequestCommand{constructor(t){const{key:s}=t;super(),this.method=e.APIRequestMethod.GET,this.path=`${e.API_PATH_AI_AGENT}/sdk_message_templates/${s}`}}class c extends e.APIResponseCommand{constructor(e,t){super(e,t),this.template=JSON.stringify(t)}}const l={};class h{constructor(e,{sdkState:t,requestQueue:s,logger:n}){this._iid=e,this._sdkState=t,this._requestQueue=s,this._logger=n,l[e]=this}static of(e){return l[e]}requestMessengerSettings(t){return e.__awaiter(this,void 0,void 0,(function*(){const{requestQueue:r}=e.Vault.of(this._iid),i=new s(t),o=yield r.commandRouter.send(i),{settings:a}=o.as(n);return a}))}getConversations(t,s,n){return e.__awaiter(this,void 0,void 0,(function*(){const{requestQueue:o}=e.Vault.of(this._iid),a=new r(Object.assign(Object.assign({},s),{token:t,limit:n})),u=yield o.send(a),{conversations:d,token:c}=u.as(i);return{conversations:d,token:c}}))}getMessageTemplates(t={}){return e.__awaiter(this,void 0,void 0,(function*(){const{keys:e,limit:s}=t,n=new a({keys:e,limit:s}),r=yield this._requestQueue.send(n),{templates:i,token:o}=r.as(u);return{templates:i,token:o}}))}getMessageTemplate(t){return e.__awaiter(this,void 0,void 0,(function*(){const e=new d({key:t}),s=yield this._requestQueue.send(e),{template:n}=s.as(c);return{template:n}}))}}var g;exports.ConversationListOrder=void 0,(g=exports.ConversationListOrder||(exports.ConversationListOrder={})).CREATED_AT="created_at",g.UPDATED_AT="updated_at";const p={status:void 0,aiAgentId:void 0,reverse:!1,order:exports.ConversationListOrder.UPDATED_AT};class _ extends e.BaseListQuery{constructor(e,t){var s,n,r,i;super(e,t),this.status=null!==(s=t.status)&&void 0!==s?s:void 0,this.aiAgentId=null!==(n=t.aiAgentId)&&void 0!==n?n:void 0,this.reverse=null!==(r=t.reverse)&&void 0!==r?r:p.reverse,this.order=null!==(i=t.order)&&void 0!==i?i:p.order}_validate(){return super._validate()&&e.isEnumOf(t.ConversationStatus,this.status,!0)&&e.isTypeOf("string",this.aiAgentId,!0)&&e.isTypeOf("boolean",this.reverse)&&e.isEnumOf(exports.ConversationListOrder,this.order)}serialize(){return e.serialize(this)}next(){return e.__awaiter(this,void 0,void 0,(function*(){const t=h.of(this._iid);if(this._validate()){if(this._isLoading)throw e.SendbirdError.queryInProgress;if(this._hasNext){this._isLoading=!0;const{conversations:s,token:n}=yield t.getConversations(this._token,e.undefineNullProps(Object.assign({},this)),this.limit);return this._token=n,this._hasNext=!!n,this._isLoading=!1,s}return[]}throw e.SendbirdError.invalidParameters}))}}class m extends e.Module{constructor(){super(...arguments),this.name="aiAgent"}init(e,{sdkState:t,dispatcher:s,sessionManager:n,requestQueue:r,logger:i,onlineDetector:o,cacheContext:a}){super.init(e,{sdkState:t,dispatcher:s,sessionManager:n,requestQueue:r,logger:i,onlineDetector:o,cacheContext:a}),this._manager=new h(e,{sdkState:t,requestQueue:r,logger:i})}requestMessengerSettings(t){return e.__awaiter(this,void 0,void 0,(function*(){const{aiAgentId:s,userId:n,language:r,country:i,context:o,forceCreateChannel:a}=t;return e.unless(e.isTypeOf("string",s)&&e.isTypeOf("string",n,!0)&&e.isTypeOf("string",r,!0)&&e.isTypeOf("string",i,!0)&&e.isTypeOf("object",o,!0)&&e.isTypeOf("boolean",a,!0)).throw(e.SendbirdError.invalidParameters),this._manager.requestMessengerSettings(t)}))}createConversationListQuery(e={}){return new _(this._iid,e)}getMessageTemplates(t={}){return e.__awaiter(this,void 0,void 0,(function*(){const s=Object.assign(Object.assign({},o),t);return e.unless((t=>e.isTypeOf("number",t.limit,!0)&&e.isArrayOf("string",t.keys,!0))(s)).throw(e.SendbirdError.invalidParameters),this._manager.getMessageTemplates(t)}))}getMessageTemplate(t){return e.__awaiter(this,void 0,void 0,(function*(){return e.unless(e.isTypeOf("string",t)).throw(e.SendbirdError.invalidParameters),this._manager.getMessageTemplate(t)}))}}exports.AIAgentInfo=e.AIAgentInfo,exports.Conversation=t.Conversation,exports.ConversationChannelInfo=t.ConversationChannelInfo,exports.ConversationHandoff=t.ConversationHandoff,exports.ConversationResolution=t.ConversationResolution,Object.defineProperty(exports,"ConversationStatus",{enumerable:!0,get:function(){return t.ConversationStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),exports.AIAgentModule=m,exports.ConversationListQuery=_;

cjs/aiAgent.d.cts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export {
2+
AIAgentInfo,
3+
AIAgentMessageTemplateListParams,
4+
AIAgentMessageTemplateListResult,
5+
AIAgentModule,
6+
Conversation,
7+
ConversationChannelInfo,
8+
ConversationHandoff,
9+
ConversationListOrder,
10+
ConversationListQuery,
11+
ConversationListQueryParams,
12+
ConversationResolution,
13+
ConversationStatus,
14+
ConversationType,
15+
MessageTemplate,
16+
MessengerSettingsParams,
17+
} from './lib/__definition.cjs';

cjs/feedChannel.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cjs/groupChannel.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cjs/index.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cjs/index.d.cts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import './groupChannel.d.cts';
33
import './openChannel.d.cts';
44
import './poll.d.cts';
55
import './feedChannel.d.cts';
6+
import './aiAgent.d.cts';
67
import './node.d.cts';
78

89
export {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var e=require("./__bundle-3e3d7eec.cjs");exports.xmlHttpRequest=(r,s)=>new Promise(((t,o)=>{if("undefined"!=typeof XMLHttpRequest){const{dispatcher:n,logger:d}=e.Vault.of(r),{requestId:a,method:i,url:u,headers:p={},data:c="",uploadProgressHandler:l}=s;let m=!1;const E=new XMLHttpRequest;E.open(i,u),Object.keys(p).forEach((e=>{E.setRequestHeader(e,p[e])})),l&&E.upload.addEventListener("progress",(e=>{e.lengthComputable?l(a,e.loaded,e.total):d.debug("Progress computing failed: `Content-Length` header is not given.")})),E.onabort=()=>{o(e.SendbirdError.requestCanceled)},E.onerror=r=>{o(e.SendbirdError.networkError)},E.onreadystatechange=()=>{if(E.readyState===XMLHttpRequest.DONE&&!m)if(0===E.status||E.status>=200&&E.status<400)try{const s=JSON.parse(E.responseText);t(new e.APIResponseCommand(r,s))}catch(r){o(e.SendbirdError.networkError)}else try{const r=JSON.parse(E.responseText);if(r){const s=new e.SendbirdError(r);if(s.isSessionExpiredError){if(n.dispatch(new e.SessionExpiredCommand({reason:s.code,message:s.message})),!(E instanceof e.SessionRefreshAPICommand)){const r=new e.Deferred;return n.dispatch(new e.RequestResendCommand({request:E,deferred:r,error:s})),r.promise}}else s.isSessionInvalidatedError&&n.dispatch(new e.SessionExpiredCommand({reason:s.code,message:s.message}));o(s)}else o(e.SendbirdError.requestFailed)}catch(r){o(e.SendbirdError.requestFailed)}},n.on((r=>{r instanceof e.CancelXMLHttpRequestCommand&&(r.requestId&&r.requestId!==a||(m=!0,E.abort()))})),E.send(c)}else o(e.SendbirdError.xmlHttpRequestNotSupported)}));
1+
var e=require("./__bundle-a6c826ee.cjs");exports.xmlHttpRequest=(r,s)=>new Promise(((t,o)=>{if("undefined"!=typeof XMLHttpRequest){const{dispatcher:n,logger:d}=e.Vault.of(r),{requestId:a,method:i,url:u,headers:p={},data:c="",uploadProgressHandler:l}=s;let m=!1;const E=new XMLHttpRequest;E.open(i,u),Object.keys(p).forEach((e=>{E.setRequestHeader(e,p[e])})),l&&E.upload.addEventListener("progress",(e=>{e.lengthComputable?l(a,e.loaded,e.total):d.debug("Progress computing failed: `Content-Length` header is not given.")})),E.onabort=()=>{o(e.SendbirdError.requestCanceled)},E.onerror=r=>{o(e.SendbirdError.networkError)},E.onreadystatechange=()=>{if(E.readyState===XMLHttpRequest.DONE&&!m)if(0===E.status||E.status>=200&&E.status<400)try{const s=JSON.parse(E.responseText);t(new e.APIResponseCommand(r,s))}catch(r){o(e.SendbirdError.networkError)}else try{const r=JSON.parse(E.responseText);if(r){const s=new e.SendbirdError(r);if(s.isSessionExpiredError){if(n.dispatch(new e.SessionExpiredCommand({reason:s.code,message:s.message})),!(E instanceof e.SessionRefreshAPICommand)){const r=new e.Deferred;return n.dispatch(new e.RequestResendCommand({request:E,deferred:r,error:s})),r.promise}}else s.isSessionInvalidatedError&&n.dispatch(new e.SessionExpiredCommand({reason:s.code,message:s.message}));o(s)}else o(e.SendbirdError.requestFailed)}catch(r){o(e.SendbirdError.requestFailed)}},n.on((r=>{r instanceof e.CancelXMLHttpRequestCommand&&(r.requestId&&r.requestId!==a||(m=!0,E.abort()))})),E.send(c)}else o(e.SendbirdError.xmlHttpRequestNotSupported)}));

0 commit comments

Comments
 (0)