Skip to content

Commit

Permalink
feat: Add advanced bot configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ze3m committed Sep 19, 2024
1 parent 38174f3 commit 0457fbb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/handlers/api/v1/bot/bot/api.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const createBotAPIHandler = async (
question_generator_prompt,
system_prompt,
temperature,
options
} = request.body;

const prisma = request.server.prisma;
Expand Down Expand Up @@ -112,6 +113,7 @@ export const createBotAPIHandler = async (

const bot = await prisma.bot.create({
data: {
...options,
name,
embedding: embeddingInfo.model_id,
model: modelInfo.model_id,
Expand Down
10 changes: 10 additions & 0 deletions server/src/handlers/api/v1/bot/bot/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ export interface CreateBotAPIRequest {
system_prompt?: string;
question_generator_prompt?: string;
temperature?: number;
options?: {
noOfDocumentsToRetrieve?: number,
noOfChatHistoryInContext?: number,
publicBotPwdProtected? : boolean,
semanticSearchSimilarityScore?: "none" |"0.2" |"0.5" |"0.7"
autoResetSession?: boolean,
internetSearchEnabled?: boolean
use_hybrid_search?: boolean
autoSyncDataSources?: boolean
}
};
}

Expand Down
32 changes: 32 additions & 0 deletions server/src/schema/api/v1/bot/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,38 @@ export const createBotAPISchema: FastifySchema = {
temperature: {
type: "number",
},
options: {
type: "object",
properties: {
noOfDocumentsToRetrieve: {
type: "number",
},
noOfChatHistoryInContext: {
type: "number",
},
semanticSearchSimilarityScore: {
type: "string",
enum: ["none", "0.2", "0.5", "0.7"],
default: "none"
},
autoResetSession: {
type: "boolean",
default: false,
},
internetSearchEnabled: {
type: "boolean",
default: false,
},
use_hybrid_search: {
type: "boolean",
default: false,
},
autoSyncDataSources: {
type: "boolean",
default: false,
},
},
},
},
},
};
Expand Down

0 comments on commit 0457fbb

Please sign in to comment.