@fonoster/common
Advanced tools
Comparing version 0.8.36 to 0.8.39
@@ -9,7 +9,7 @@ import { z } from "zod"; | ||
initialDtmf: z.ZodOptional<z.ZodString>; | ||
maxSpeechWaitTimeout: z.ZodNumber; | ||
maxSpeechWaitTimeout: z.ZodDefault<z.ZodNumber>; | ||
transferOptions: z.ZodOptional<z.ZodObject<{ | ||
phoneNumber: z.ZodString; | ||
message: z.ZodString; | ||
timeout: z.ZodOptional<z.ZodNumber>; | ||
timeout: z.ZodDefault<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -24,6 +24,6 @@ message?: string; | ||
}>>; | ||
idleOptions: z.ZodOptional<z.ZodObject<{ | ||
idleOptions: z.ZodObject<{ | ||
message: z.ZodString; | ||
timeout: z.ZodNumber; | ||
maxTimeoutCount: z.ZodNumber; | ||
timeout: z.ZodDefault<z.ZodNumber>; | ||
maxTimeoutCount: z.ZodDefault<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -37,4 +37,4 @@ message?: string; | ||
maxTimeoutCount?: number; | ||
}>>; | ||
vad: z.ZodObject<{ | ||
}>; | ||
vad: z.ZodDefault<z.ZodObject<{ | ||
pathToModel: z.ZodOptional<z.ZodString>; | ||
@@ -54,3 +54,3 @@ activationThreshold: z.ZodNumber; | ||
debounceFrames?: number; | ||
}>; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -110,3 +110,3 @@ firstMessage?: string; | ||
baseUrl: z.ZodOptional<z.ZodString>; | ||
knowledgeBase: z.ZodArray<z.ZodObject<{ | ||
knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
type: z.ZodEnum<["s3"]>; | ||
@@ -123,4 +123,4 @@ title: z.ZodString; | ||
document?: string; | ||
}>, "many">; | ||
tools: z.ZodArray<z.ZodObject<{ | ||
}>, "many">>; | ||
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
@@ -234,3 +234,3 @@ description: z.ZodString; | ||
}; | ||
}>, "many">; | ||
}>, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -237,0 +237,0 @@ provider?: import("./LanguageModelProvider").LanguageModelProvider; |
@@ -8,7 +8,7 @@ import { z } from "zod"; | ||
initialDtmf: z.ZodOptional<z.ZodString>; | ||
maxSpeechWaitTimeout: z.ZodNumber; | ||
maxSpeechWaitTimeout: z.ZodDefault<z.ZodNumber>; | ||
transferOptions: z.ZodOptional<z.ZodObject<{ | ||
phoneNumber: z.ZodString; | ||
message: z.ZodString; | ||
timeout: z.ZodOptional<z.ZodNumber>; | ||
timeout: z.ZodDefault<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -23,6 +23,6 @@ message?: string; | ||
}>>; | ||
idleOptions: z.ZodOptional<z.ZodObject<{ | ||
idleOptions: z.ZodObject<{ | ||
message: z.ZodString; | ||
timeout: z.ZodNumber; | ||
maxTimeoutCount: z.ZodNumber; | ||
timeout: z.ZodDefault<z.ZodNumber>; | ||
maxTimeoutCount: z.ZodDefault<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -36,4 +36,4 @@ message?: string; | ||
maxTimeoutCount?: number; | ||
}>>; | ||
vad: z.ZodObject<{ | ||
}>; | ||
vad: z.ZodDefault<z.ZodObject<{ | ||
pathToModel: z.ZodOptional<z.ZodString>; | ||
@@ -53,3 +53,3 @@ activationThreshold: z.ZodNumber; | ||
debounceFrames?: number; | ||
}>; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -56,0 +56,0 @@ firstMessage?: string; |
@@ -58,2 +58,8 @@ "use strict"; | ||
const NUMBER_BETWEEN_0_AND_1 = "Must be a number between 0 and 1"; | ||
const MAX_SPEECH_WAIT_TIMEOUT = 10000; | ||
const IDLE_OPTIONS_TIMEOUT = 10000; | ||
const IDLE_OPTIONS_MAX_TIMEOUT_COUNT = 3; | ||
const VAD_ACTIVATION_THRESHOLD = 0.3; | ||
const VAD_DEACTIVATION_THRESHOLD = 0.15; | ||
const VAD_DEBOUNCE_FRAMES = 1; | ||
const conversationSettingsSchema = zod_1.z.object({ | ||
@@ -71,3 +77,4 @@ firstMessage: zod_1.z.string().optional(), | ||
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }), | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
.default(MAX_SPEECH_WAIT_TIMEOUT), | ||
transferOptions: zod_1.z | ||
@@ -81,7 +88,6 @@ .object({ | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
.optional() | ||
.default(30000) | ||
}) | ||
.optional(), | ||
idleOptions: zod_1.z | ||
.object({ | ||
idleOptions: zod_1.z.object({ | ||
message: zod_1.z.string(), | ||
@@ -91,3 +97,4 @@ timeout: zod_1.z | ||
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }), | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
.default(IDLE_OPTIONS_TIMEOUT), | ||
maxTimeoutCount: zod_1.z | ||
@@ -97,5 +104,6 @@ .number() | ||
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }) | ||
}) | ||
.optional(), | ||
vad: zod_1.z.object({ | ||
.default(IDLE_OPTIONS_MAX_TIMEOUT_COUNT) | ||
}), | ||
vad: zod_1.z | ||
.object({ | ||
pathToModel: zod_1.z.string().optional(), | ||
@@ -117,3 +125,8 @@ activationThreshold: zod_1.z | ||
}) | ||
.default({ | ||
activationThreshold: VAD_ACTIVATION_THRESHOLD, | ||
deactivationThreshold: VAD_DEACTIVATION_THRESHOLD, | ||
debounceFrames: VAD_DEBOUNCE_FRAMES | ||
}) | ||
}); | ||
exports.conversationSettingsSchema = conversationSettingsSchema; |
@@ -10,3 +10,3 @@ import { z } from "zod"; | ||
baseUrl: z.ZodOptional<z.ZodString>; | ||
knowledgeBase: z.ZodArray<z.ZodObject<{ | ||
knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
type: z.ZodEnum<["s3"]>; | ||
@@ -23,4 +23,4 @@ title: z.ZodString; | ||
document?: string; | ||
}>, "many">; | ||
tools: z.ZodArray<z.ZodObject<{ | ||
}>, "many">>; | ||
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
@@ -134,3 +134,3 @@ description: z.ZodString; | ||
}; | ||
}>, "many">; | ||
}>, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -137,0 +137,0 @@ provider?: LanguageModelProvider; |
@@ -80,3 +80,4 @@ "use strict"; | ||
.optional(), | ||
knowledgeBase: zod_1.z.array(zod_1.z.object({ | ||
knowledgeBase: zod_1.z | ||
.array(zod_1.z.object({ | ||
type: zod_1.z.enum(["s3"]), | ||
@@ -87,5 +88,6 @@ title: zod_1.z.string(), | ||
}) | ||
})), | ||
tools: zod_1.z.array(tools_1.toolSchema) | ||
})) | ||
.default([]), | ||
tools: zod_1.z.array(tools_1.toolSchema).default([]) | ||
}); | ||
exports.languageModelConfigSchema = languageModelConfigSchema; |
@@ -7,1 +7,3 @@ import { ServingStatus } from "grpc-health-check"; | ||
export declare const INFLUXDB_CALLS_BUCKET = "calls"; | ||
export declare const APP_REF_HEADER = "x-app-ref"; | ||
export declare const ROUTR_DEFAULT_PEER_AOR = "sip:voice@default"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.INFLUXDB_CALLS_BUCKET = exports.CALL_DETAIL_RECORD_MEASUREMENT = exports.STASIS_APP_NAME = exports.GRPC_SERVING_STATUS = exports.GRPC_NOT_SERVING_STATUS = void 0; | ||
exports.ROUTR_DEFAULT_PEER_AOR = exports.APP_REF_HEADER = exports.INFLUXDB_CALLS_BUCKET = exports.CALL_DETAIL_RECORD_MEASUREMENT = exports.STASIS_APP_NAME = exports.GRPC_SERVING_STATUS = exports.GRPC_NOT_SERVING_STATUS = void 0; | ||
exports.GRPC_NOT_SERVING_STATUS = "NOT_SERVING"; | ||
@@ -9,1 +9,3 @@ exports.GRPC_SERVING_STATUS = "SERVING"; | ||
exports.INFLUXDB_CALLS_BUCKET = "calls"; | ||
exports.APP_REF_HEADER = "x-app-ref"; | ||
exports.ROUTR_DEFAULT_PEER_AOR = "sip:voice@default"; |
{ | ||
"name": "@fonoster/common", | ||
"version": "0.8.36", | ||
"version": "0.8.39", | ||
"description": "Common library for Fonoster projects", | ||
@@ -21,3 +21,3 @@ "author": "Pedro Sanders <psanders@fonoster.com>", | ||
"dependencies": { | ||
"@fonoster/logger": "^0.8.36", | ||
"@fonoster/logger": "^0.8.39", | ||
"@grpc/grpc-js": "~1.10.6", | ||
@@ -52,3 +52,3 @@ "@grpc/proto-loader": "^0.7.12", | ||
}, | ||
"gitHead": "195148523d62577c53d8f2f4ad184c373476b6f7" | ||
"gitHead": "3ba2a5330d268f5be03fd9d5bbd22aeeb264fa61" | ||
} |
580512
13868
Updated@fonoster/logger@^0.8.39