@baishuyun/coze-provider 0.1.0 → 1.0.0

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.
@@ -1,12 +1,12 @@
1
- import { buildWidgetName } from "../build-widget-name";
1
+ import { buildWidgetName } from '../build-widget-name';
2
2
 
3
3
  export const rebuildSn = (truncatedJson: unknown) => {
4
4
  const { widget, label, ...rest } = (truncatedJson as any) || {};
5
5
  return {
6
6
  widget: {
7
- type: "sn",
7
+ type: 'sn',
8
8
  widgetName: buildWidgetName(),
9
- widgetNameAlias: "",
9
+ widgetNameAlias: '',
10
10
  triggerEvent: 0,
11
11
  customCls: null,
12
12
  width: 350,
@@ -15,6 +15,19 @@ export const rebuildSn = (truncatedJson: unknown) => {
15
15
  // rules: rules,
16
16
  importMode: 1, //导入模式 1 excel末尾递增 2 excel最大值递增 3 excel/表单最大值比较递增
17
17
  ...widget,
18
+ rules: [
19
+ {
20
+ chars: 'sn-',
21
+ type: 'fixedChars',
22
+ },
23
+ {
24
+ digitsNum: 5,
25
+ fixedLength: true,
26
+ resetDuration: 'none',
27
+ startValue: 1,
28
+ type: 'incNumber',
29
+ },
30
+ ],
18
31
  labelStyle: label,
19
32
  },
20
33
  // description,
@@ -7,7 +7,6 @@ import {
7
7
  import { RoleType } from '@coze/api';
8
8
  import { Attachment } from '@baishuyun/types/src/chat';
9
9
  import { excel2json } from './excel2json';
10
- import { parseMultiModalMessage } from './parse-multi-modal-message';
11
10
 
12
11
  const decoder = new TextDecoder('utf-8');
13
12
 
@@ -20,16 +19,7 @@ type userMsg = {
20
19
  content: Array<LanguageModelV2TextPart | LanguageModelV2FilePart>;
21
20
  };
22
21
 
23
- const isMultiModalMsg = (message: userMsg) =>
24
- message.content.some((part) => {
25
- return (part.providerOptions?.uploadMetadata?.contentType as string)?.startsWith('image/');
26
- });
27
-
28
22
  const parseMessageContent = (message: LanguageModelV2Message, isMultiModalMsg?: boolean) => {
29
- // if (isMultiModalMsg) {
30
- // return parseMultiModalMessage(message as userMsg);
31
- // }
32
-
33
23
  const result = (message.content as Array<LanguageModelV2TextPart | LanguageModelV2FilePart>)
34
24
  .map((part) => {
35
25
  if (part.type === 'text') {