wtfai 1.5.3 → 1.5.5

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/README.md CHANGED
@@ -404,6 +404,14 @@ const result = await IframeBridge.executeWorkflow('target-workflow-id', {
404
404
  console.log(result); // 执行产生的所有消息
405
405
  ```
406
406
 
407
+ #### `IframeBridge.updateSessionTitle(title)`
408
+
409
+ 更新当前会话的标题。
410
+
411
+ ```javascript
412
+ await IframeBridge.updateSessionTitle('新的标题');
413
+ ```
414
+
407
415
  #### `IframeBridge.uploadFile(file, options?)`
408
416
 
409
417
  上传文件到云存储,返回 CDN URL。
@@ -48,6 +48,10 @@ class IframeBridgeHost {
48
48
  } else if ('executeWorkflow' === method) {
49
49
  const [workflowId, input] = params;
50
50
  result = await this.session.executeWorkflow(workflowId, input);
51
+ } else if ('updateSessionTitle' === method) {
52
+ const [title] = params;
53
+ await this.session.updateSessionTitle(title);
54
+ result = true;
51
55
  } else if ('uploadFile' === method) {
52
56
  const [options] = params;
53
57
  result = await this.session.uploadFileFromIframe(options);
@@ -73,7 +77,8 @@ class IframeBridgeHost {
73
77
  'loadData',
74
78
  'hasMethod',
75
79
  'executeWorkflow',
76
- 'uploadFile'
80
+ 'uploadFile',
81
+ 'updateSessionTitle'
77
82
  ];
78
83
  if (builtIns.includes(methodName)) return true;
79
84
  const userMethods = this.session.getIframeMethods();
package/dist/session.js CHANGED
@@ -91,7 +91,7 @@ class WorkflowSession {
91
91
  const variables = data.variables || {};
92
92
  this.updateState({
93
93
  messages: data.messages,
94
- title: variables.conversationTitle
94
+ title: variables.sessionTitle
95
95
  });
96
96
  }
97
97
  async getWorkflowVariables() {
@@ -126,7 +126,7 @@ class WorkflowSession {
126
126
  const executionInput = {
127
127
  messages: [],
128
128
  variables: {
129
- conversationTitle: title
129
+ sessionTitle: title
130
130
  }
131
131
  };
132
132
  return new Promise((resolve, reject)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfai",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {