Skip to content

Commit 0457fbb

Browse files
committed
feat: Add advanced bot configuration options
1 parent 38174f3 commit 0457fbb

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

server/src/handlers/api/v1/bot/bot/api.handler.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const createBotAPIHandler = async (
2929
question_generator_prompt,
3030
system_prompt,
3131
temperature,
32+
options
3233
} = request.body;
3334

3435
const prisma = request.server.prisma;
@@ -112,6 +113,7 @@ export const createBotAPIHandler = async (
112113

113114
const bot = await prisma.bot.create({
114115
data: {
116+
...options,
115117
name,
116118
embedding: embeddingInfo.model_id,
117119
model: modelInfo.model_id,

server/src/handlers/api/v1/bot/bot/types.ts

+10
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ export interface CreateBotAPIRequest {
9696
system_prompt?: string;
9797
question_generator_prompt?: string;
9898
temperature?: number;
99+
options?: {
100+
noOfDocumentsToRetrieve?: number,
101+
noOfChatHistoryInContext?: number,
102+
publicBotPwdProtected? : boolean,
103+
semanticSearchSimilarityScore?: "none" |"0.2" |"0.5" |"0.7"
104+
autoResetSession?: boolean,
105+
internetSearchEnabled?: boolean
106+
use_hybrid_search?: boolean
107+
autoSyncDataSources?: boolean
108+
}
99109
};
100110
}
101111

server/src/schema/api/v1/bot/bot/index.ts

+32
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,38 @@ export const createBotAPISchema: FastifySchema = {
244244
temperature: {
245245
type: "number",
246246
},
247+
options: {
248+
type: "object",
249+
properties: {
250+
noOfDocumentsToRetrieve: {
251+
type: "number",
252+
},
253+
noOfChatHistoryInContext: {
254+
type: "number",
255+
},
256+
semanticSearchSimilarityScore: {
257+
type: "string",
258+
enum: ["none", "0.2", "0.5", "0.7"],
259+
default: "none"
260+
},
261+
autoResetSession: {
262+
type: "boolean",
263+
default: false,
264+
},
265+
internetSearchEnabled: {
266+
type: "boolean",
267+
default: false,
268+
},
269+
use_hybrid_search: {
270+
type: "boolean",
271+
default: false,
272+
},
273+
autoSyncDataSources: {
274+
type: "boolean",
275+
default: false,
276+
},
277+
},
278+
},
247279
},
248280
},
249281
};

0 commit comments

Comments
 (0)