@fonoster/common 0.9.46 → 0.9.48
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/dist/assistants/LanguageModelProvider.d.ts +3 -1
- package/dist/assistants/LanguageModelProvider.js +2 -0
- package/dist/assistants/assistantSchema.d.ts +13 -13
- package/dist/assistants/conversationSettingsSchema.js +6 -5
- package/dist/assistants/languageModelConfigSchema.d.ts +11 -11
- package/dist/assistants/tools/propertySchema.d.ts +5 -5
- package/dist/assistants/tools/propertySchema.js +2 -1
- package/dist/assistants/tools/toolSchema.d.ts +9 -9
- package/package.json +2 -2
|
@@ -24,4 +24,6 @@ var LanguageModelProvider;
|
|
|
24
24
|
LanguageModelProvider["OPENAI"] = "openai";
|
|
25
25
|
LanguageModelProvider["GROQ"] = "groq";
|
|
26
26
|
LanguageModelProvider["OLLAMA"] = "ollama";
|
|
27
|
+
LanguageModelProvider["GOOGLE"] = "google";
|
|
28
|
+
LanguageModelProvider["ANTHROPIC"] = "anthropic";
|
|
27
29
|
})(LanguageModelProvider || (exports.LanguageModelProvider = LanguageModelProvider = {}));
|
|
@@ -144,23 +144,23 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
144
144
|
type: z.ZodEnum<["object", "array"]>;
|
|
145
145
|
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
146
146
|
type: z.ZodString;
|
|
147
|
-
format: z.ZodOptional<z.
|
|
147
|
+
format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
|
|
148
148
|
pattern: z.ZodOptional<z.ZodString>;
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
150
150
|
type?: string;
|
|
151
|
-
format?:
|
|
151
|
+
format?: "enum" | "date-time";
|
|
152
152
|
pattern?: string;
|
|
153
153
|
}, {
|
|
154
154
|
type?: string;
|
|
155
|
-
format?:
|
|
155
|
+
format?: "enum" | "date-time";
|
|
156
156
|
pattern?: string;
|
|
157
157
|
}>, {
|
|
158
158
|
type?: string;
|
|
159
|
-
format?:
|
|
159
|
+
format?: "enum" | "date-time";
|
|
160
160
|
pattern?: string;
|
|
161
161
|
}, {
|
|
162
162
|
type?: string;
|
|
163
|
-
format?:
|
|
163
|
+
format?: "enum" | "date-time";
|
|
164
164
|
pattern?: string;
|
|
165
165
|
}>>;
|
|
166
166
|
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -168,7 +168,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
168
168
|
type?: "object" | "array";
|
|
169
169
|
properties?: Record<string, {
|
|
170
170
|
type?: string;
|
|
171
|
-
format?:
|
|
171
|
+
format?: "enum" | "date-time";
|
|
172
172
|
pattern?: string;
|
|
173
173
|
}>;
|
|
174
174
|
required?: string[];
|
|
@@ -176,7 +176,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
176
176
|
type?: "object" | "array";
|
|
177
177
|
properties?: Record<string, {
|
|
178
178
|
type?: string;
|
|
179
|
-
format?:
|
|
179
|
+
format?: "enum" | "date-time";
|
|
180
180
|
pattern?: string;
|
|
181
181
|
}>;
|
|
182
182
|
required?: string[];
|
|
@@ -205,7 +205,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
205
205
|
type?: "object" | "array";
|
|
206
206
|
properties?: Record<string, {
|
|
207
207
|
type?: string;
|
|
208
|
-
format?:
|
|
208
|
+
format?: "enum" | "date-time";
|
|
209
209
|
pattern?: string;
|
|
210
210
|
}>;
|
|
211
211
|
required?: string[];
|
|
@@ -224,7 +224,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
224
224
|
type?: "object" | "array";
|
|
225
225
|
properties?: Record<string, {
|
|
226
226
|
type?: string;
|
|
227
|
-
format?:
|
|
227
|
+
format?: "enum" | "date-time";
|
|
228
228
|
pattern?: string;
|
|
229
229
|
}>;
|
|
230
230
|
required?: string[];
|
|
@@ -256,7 +256,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
256
256
|
type?: "object" | "array";
|
|
257
257
|
properties?: Record<string, {
|
|
258
258
|
type?: string;
|
|
259
|
-
format?:
|
|
259
|
+
format?: "enum" | "date-time";
|
|
260
260
|
pattern?: string;
|
|
261
261
|
}>;
|
|
262
262
|
required?: string[];
|
|
@@ -288,7 +288,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
288
288
|
type?: "object" | "array";
|
|
289
289
|
properties?: Record<string, {
|
|
290
290
|
type?: string;
|
|
291
|
-
format?:
|
|
291
|
+
format?: "enum" | "date-time";
|
|
292
292
|
pattern?: string;
|
|
293
293
|
}>;
|
|
294
294
|
required?: string[];
|
|
@@ -560,7 +560,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
560
560
|
type?: "object" | "array";
|
|
561
561
|
properties?: Record<string, {
|
|
562
562
|
type?: string;
|
|
563
|
-
format?:
|
|
563
|
+
format?: "enum" | "date-time";
|
|
564
564
|
pattern?: string;
|
|
565
565
|
}>;
|
|
566
566
|
required?: string[];
|
|
@@ -654,7 +654,7 @@ declare const assistantSchema: z.ZodObject<{
|
|
|
654
654
|
type?: "object" | "array";
|
|
655
655
|
properties?: Record<string, {
|
|
656
656
|
type?: string;
|
|
657
|
-
format?:
|
|
657
|
+
format?: "enum" | "date-time";
|
|
658
658
|
pattern?: string;
|
|
659
659
|
}>;
|
|
660
660
|
required?: string[];
|
|
@@ -54,13 +54,14 @@ exports.conversationSettingsSchema = void 0;
|
|
|
54
54
|
*/
|
|
55
55
|
const zod_1 = require("zod");
|
|
56
56
|
const Messages = __importStar(require("../messages"));
|
|
57
|
+
const ZERO_OR_GREATER_THAN_ZERO = "Must be a number greater than or equal to 0";
|
|
57
58
|
const NUMBER_BETWEEN_0_AND_1 = "Must be a number between 0 and 1";
|
|
58
|
-
const MAX_SPEECH_WAIT_TIMEOUT =
|
|
59
|
+
const MAX_SPEECH_WAIT_TIMEOUT = 0;
|
|
59
60
|
const IDLE_OPTIONS_TIMEOUT = 10000;
|
|
60
|
-
const IDLE_OPTIONS_MAX_TIMEOUT_COUNT =
|
|
61
|
-
const VAD_ACTIVATION_THRESHOLD = 0.
|
|
61
|
+
const IDLE_OPTIONS_MAX_TIMEOUT_COUNT = 2;
|
|
62
|
+
const VAD_ACTIVATION_THRESHOLD = 0.4;
|
|
62
63
|
const VAD_DEACTIVATION_THRESHOLD = 0.25;
|
|
63
|
-
const VAD_DEBOUNCE_FRAMES =
|
|
64
|
+
const VAD_DEBOUNCE_FRAMES = 4;
|
|
64
65
|
const conversationSettingsSchema = zod_1.z.object({
|
|
65
66
|
firstMessage: zod_1.z.string().optional(),
|
|
66
67
|
systemPrompt: zod_1.z.string(),
|
|
@@ -78,7 +79,7 @@ const conversationSettingsSchema = zod_1.z.object({
|
|
|
78
79
|
maxSpeechWaitTimeout: zod_1.z
|
|
79
80
|
.number()
|
|
80
81
|
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
81
|
-
.
|
|
82
|
+
.gte(0, { message: ZERO_OR_GREATER_THAN_ZERO })
|
|
82
83
|
.default(MAX_SPEECH_WAIT_TIMEOUT),
|
|
83
84
|
transferOptions: zod_1.z
|
|
84
85
|
.object({
|
|
@@ -45,23 +45,23 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
45
45
|
type: z.ZodEnum<["object", "array"]>;
|
|
46
46
|
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
47
47
|
type: z.ZodString;
|
|
48
|
-
format: z.ZodOptional<z.
|
|
48
|
+
format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
|
|
49
49
|
pattern: z.ZodOptional<z.ZodString>;
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
51
|
type?: string;
|
|
52
|
-
format?:
|
|
52
|
+
format?: "enum" | "date-time";
|
|
53
53
|
pattern?: string;
|
|
54
54
|
}, {
|
|
55
55
|
type?: string;
|
|
56
|
-
format?:
|
|
56
|
+
format?: "enum" | "date-time";
|
|
57
57
|
pattern?: string;
|
|
58
58
|
}>, {
|
|
59
59
|
type?: string;
|
|
60
|
-
format?:
|
|
60
|
+
format?: "enum" | "date-time";
|
|
61
61
|
pattern?: string;
|
|
62
62
|
}, {
|
|
63
63
|
type?: string;
|
|
64
|
-
format?:
|
|
64
|
+
format?: "enum" | "date-time";
|
|
65
65
|
pattern?: string;
|
|
66
66
|
}>>;
|
|
67
67
|
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -69,7 +69,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
69
69
|
type?: "object" | "array";
|
|
70
70
|
properties?: Record<string, {
|
|
71
71
|
type?: string;
|
|
72
|
-
format?:
|
|
72
|
+
format?: "enum" | "date-time";
|
|
73
73
|
pattern?: string;
|
|
74
74
|
}>;
|
|
75
75
|
required?: string[];
|
|
@@ -77,7 +77,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
77
77
|
type?: "object" | "array";
|
|
78
78
|
properties?: Record<string, {
|
|
79
79
|
type?: string;
|
|
80
|
-
format?:
|
|
80
|
+
format?: "enum" | "date-time";
|
|
81
81
|
pattern?: string;
|
|
82
82
|
}>;
|
|
83
83
|
required?: string[];
|
|
@@ -106,7 +106,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
106
106
|
type?: "object" | "array";
|
|
107
107
|
properties?: Record<string, {
|
|
108
108
|
type?: string;
|
|
109
|
-
format?:
|
|
109
|
+
format?: "enum" | "date-time";
|
|
110
110
|
pattern?: string;
|
|
111
111
|
}>;
|
|
112
112
|
required?: string[];
|
|
@@ -125,7 +125,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
125
125
|
type?: "object" | "array";
|
|
126
126
|
properties?: Record<string, {
|
|
127
127
|
type?: string;
|
|
128
|
-
format?:
|
|
128
|
+
format?: "enum" | "date-time";
|
|
129
129
|
pattern?: string;
|
|
130
130
|
}>;
|
|
131
131
|
required?: string[];
|
|
@@ -157,7 +157,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
157
157
|
type?: "object" | "array";
|
|
158
158
|
properties?: Record<string, {
|
|
159
159
|
type?: string;
|
|
160
|
-
format?:
|
|
160
|
+
format?: "enum" | "date-time";
|
|
161
161
|
pattern?: string;
|
|
162
162
|
}>;
|
|
163
163
|
required?: string[];
|
|
@@ -189,7 +189,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
|
|
|
189
189
|
type?: "object" | "array";
|
|
190
190
|
properties?: Record<string, {
|
|
191
191
|
type?: string;
|
|
192
|
-
format?:
|
|
192
|
+
format?: "enum" | "date-time";
|
|
193
193
|
pattern?: string;
|
|
194
194
|
}>;
|
|
195
195
|
required?: string[];
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
import { z } from "zod";
|
|
20
20
|
declare const propertySchema: z.ZodEffects<z.ZodObject<{
|
|
21
21
|
type: z.ZodString;
|
|
22
|
-
format: z.ZodOptional<z.
|
|
22
|
+
format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
|
|
23
23
|
pattern: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
type?: string;
|
|
26
|
-
format?:
|
|
26
|
+
format?: "enum" | "date-time";
|
|
27
27
|
pattern?: string;
|
|
28
28
|
}, {
|
|
29
29
|
type?: string;
|
|
30
|
-
format?:
|
|
30
|
+
format?: "enum" | "date-time";
|
|
31
31
|
pattern?: string;
|
|
32
32
|
}>, {
|
|
33
33
|
type?: string;
|
|
34
|
-
format?:
|
|
34
|
+
format?: "enum" | "date-time";
|
|
35
35
|
pattern?: string;
|
|
36
36
|
}, {
|
|
37
37
|
type?: string;
|
|
38
|
-
format?:
|
|
38
|
+
format?: "enum" | "date-time";
|
|
39
39
|
pattern?: string;
|
|
40
40
|
}>;
|
|
41
41
|
export { propertySchema };
|
|
@@ -23,7 +23,8 @@ const zod_1 = require("zod");
|
|
|
23
23
|
const propertySchema = zod_1.z
|
|
24
24
|
.object({
|
|
25
25
|
type: zod_1.z.string(),
|
|
26
|
-
|
|
26
|
+
// NOTICE: We are adopting Gemini's format which only supports 'enum' and 'date-time'
|
|
27
|
+
format: zod_1.z.enum(["enum", "date-time"]).optional(),
|
|
27
28
|
pattern: zod_1.z.string().optional()
|
|
28
29
|
})
|
|
29
30
|
.refine((data) => {
|
|
@@ -25,23 +25,23 @@ declare const toolSchema: z.ZodObject<{
|
|
|
25
25
|
type: z.ZodEnum<["object", "array"]>;
|
|
26
26
|
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
27
27
|
type: z.ZodString;
|
|
28
|
-
format: z.ZodOptional<z.
|
|
28
|
+
format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
|
|
29
29
|
pattern: z.ZodOptional<z.ZodString>;
|
|
30
30
|
}, "strip", z.ZodTypeAny, {
|
|
31
31
|
type?: string;
|
|
32
|
-
format?:
|
|
32
|
+
format?: "enum" | "date-time";
|
|
33
33
|
pattern?: string;
|
|
34
34
|
}, {
|
|
35
35
|
type?: string;
|
|
36
|
-
format?:
|
|
36
|
+
format?: "enum" | "date-time";
|
|
37
37
|
pattern?: string;
|
|
38
38
|
}>, {
|
|
39
39
|
type?: string;
|
|
40
|
-
format?:
|
|
40
|
+
format?: "enum" | "date-time";
|
|
41
41
|
pattern?: string;
|
|
42
42
|
}, {
|
|
43
43
|
type?: string;
|
|
44
|
-
format?:
|
|
44
|
+
format?: "enum" | "date-time";
|
|
45
45
|
pattern?: string;
|
|
46
46
|
}>>;
|
|
47
47
|
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -49,7 +49,7 @@ declare const toolSchema: z.ZodObject<{
|
|
|
49
49
|
type?: "object" | "array";
|
|
50
50
|
properties?: Record<string, {
|
|
51
51
|
type?: string;
|
|
52
|
-
format?:
|
|
52
|
+
format?: "enum" | "date-time";
|
|
53
53
|
pattern?: string;
|
|
54
54
|
}>;
|
|
55
55
|
required?: string[];
|
|
@@ -57,7 +57,7 @@ declare const toolSchema: z.ZodObject<{
|
|
|
57
57
|
type?: "object" | "array";
|
|
58
58
|
properties?: Record<string, {
|
|
59
59
|
type?: string;
|
|
60
|
-
format?:
|
|
60
|
+
format?: "enum" | "date-time";
|
|
61
61
|
pattern?: string;
|
|
62
62
|
}>;
|
|
63
63
|
required?: string[];
|
|
@@ -86,7 +86,7 @@ declare const toolSchema: z.ZodObject<{
|
|
|
86
86
|
type?: "object" | "array";
|
|
87
87
|
properties?: Record<string, {
|
|
88
88
|
type?: string;
|
|
89
|
-
format?:
|
|
89
|
+
format?: "enum" | "date-time";
|
|
90
90
|
pattern?: string;
|
|
91
91
|
}>;
|
|
92
92
|
required?: string[];
|
|
@@ -105,7 +105,7 @@ declare const toolSchema: z.ZodObject<{
|
|
|
105
105
|
type?: "object" | "array";
|
|
106
106
|
properties?: Record<string, {
|
|
107
107
|
type?: string;
|
|
108
|
-
format?:
|
|
108
|
+
format?: "enum" | "date-time";
|
|
109
109
|
pattern?: string;
|
|
110
110
|
}>;
|
|
111
111
|
required?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/common",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.48",
|
|
4
4
|
"description": "Common library for Fonoster projects",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/nodemailer": "^6.4.14"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "7c9666911ad017363ea4d99b06c2f6cc915d5c91"
|
|
53
53
|
}
|