Skip to content

Commit

Permalink
Merge pull request #282 from n4ze3m/next
Browse files Browse the repository at this point in the history
v1.9.1
  • Loading branch information
n4ze3m authored Jul 27, 2024
2 parents 8e0d6be + 26b81a1 commit b4e8866
Show file tree
Hide file tree
Showing 18 changed files with 808 additions and 455 deletions.
2 changes: 1 addition & 1 deletion app/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app",
"private": true,
"version": "1.9.0",
"version": "1.9.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 2 additions & 0 deletions app/ui/src/@types/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export type BotSettings = {
bot_model_api_key: string;
noOfChatHistoryInContext: number;
semanticSearchSimilarityScore: string;
inactivityTimeout: number;
autoResetSession: boolean;
};
chatModel: {
label: string;
Expand Down
28 changes: 28 additions & 0 deletions app/ui/src/components/Bot/Settings/SettingsBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export const SettingsBody: React.FC<BotSettings> = ({
noOfDocumentsToRetrieve: data.noOfDocumentsToRetrieve,
noOfChatHistoryInContext: data.noOfChatHistoryInContext,
semanticSearchSimilarityScore: data.semanticSearchSimilarityScore,
autoResetSession: data.autoResetSession,
inactivityTimeout: data.inactivityTimeout,
}}
form={form}
requiredMark={false}
Expand Down Expand Up @@ -425,6 +427,32 @@ export const SettingsBody: React.FC<BotSettings> = ({
placeholder="Enter your API key here"
/>
</Form.Item>

<Form.Item
name="autoResetSession"
label="Auto Reset Chat Session"
tooltip="This will reset the chat session after a certain period of inactivity. Useful for platforms like Telegram, WhatsApp, etc."
>
<Switch />
</Form.Item>

<Form.Item
name="inactivityTimeout"
label="Inactivity Timeout"
help="Enter the time in seconds after which the chat session will be reset."
rules={[
{
required: true,
message: "Please input an inactivity timeout!",
},
]}
>
<InputNumber
min={0}
style={{ width: "100%" }}
placeholder="Enter inactivity timeout"
/>
</Form.Item>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dialoqbase",
"version": "1.9.0",
"version": "1.9.1",
"description": "Create chatbots with ease",
"scripts": {
"ui:dev": "pnpm run --filter ui dev",
Expand Down
3 changes: 3 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"concurrently": "^7.0.0",
"copyfiles": "^2.4.1",
"d3-dsv": "2",
"date-fns": "^3.6.0",
"discord.js": "^14.11.0",
"fastify": "^4.26.2",
"fastify-cli": "6.1.1",
Expand All @@ -73,6 +74,7 @@
"html-to-text": "^9.0.5",
"ignore": "^5.2.4",
"ioredis": "^5.4.1",
"jsdom": "^24.1.1",
"jsonwebtoken": "^9.0.2",
"langchain": "^0.1.25",
"mammoth": "^1.6.0",
Expand All @@ -95,6 +97,7 @@
},
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/jsdom": "^21.1.7",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "20.4.4",
"@types/pubsub-js": "^1.8.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Bot" ADD COLUMN "autoResetSession" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "inactivityTimeout" INTEGER DEFAULT 3600;
2 changes: 2 additions & 0 deletions server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ model Bot {
embedding String @default("openai")
streaming Boolean @default(false)
showRef Boolean @default(false)
inactivityTimeout Int? @default(3600)
autoResetSession Boolean @default(false)
questionGeneratorPrompt String @default("Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question. Chat History: {chat_history} Follow Up Input: {question} Standalone question:")
qaPrompt String @default("You are a helpful AI assistant. Use the following pieces of context to answer the question at the end. If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context. {context} Question: {question} Helpful answer in markdown:")
voice_to_text_type String @default("web_api")
Expand Down
Loading

0 comments on commit b4e8866

Please sign in to comment.