Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

Merge branch 'dev' into current-date-instruction

Louise6587844d0b1
diff --cc web-app/src/containers/dialogs/AddEditAssistant.tsx
index 055f20b54,abc852810..17e5654c3
--- a/web-app/src/containers/dialogs/AddEditAssistant.tsx
+++ b/web-app/src/containers/dialogs/AddEditAssistant.tsx
@@@ -321,11 -325,31 +325,34 @@@ export default function AddEditAssistan
className="resize-none"
rows={4}
/>
+ <div className="text-xs text-main-view-fg/60">
+ {t('assistants:instructionsDateHint')}
+ </div>
</div>
+ <div className="space-y-2 my-4 mt-6">
+ <div className="flex items-center justify-between">
+ <label className="text-sm">{t('common:settings')}</label>
+ </div>
+ <div className="flex justify-between items-center gap-2">
+ <div className="w-full">
+ <p className="text-sm">{t('assistants:maxToolSteps')}</p>
+ </div>
+ <Input
+ value={toolSteps}
+ type="number"
+ min={0}
+ onChange={(e) => {
+ const newSteps = e.target.value
+ const stepNumber = Number(newSteps)
+ setToolSteps(isNaN(stepNumber) ? 20 : stepNumber)
+ }}
+ placeholder="20"
+ className="w-18 text-right"
+ />
+ </div>
+ </div>
+
<div className="space-y-2 my-4">
<div className="flex items-center justify-between">
<label className="text-sm">
diff --cc web-app/src/hooks/useChat.ts
index f4530c90d,fd85797fb..e1511ee51
--- a/web-app/src/hooks/useChat.ts
+++ b/web-app/src/hooks/useChat.ts
@@@ -230,9 -239,9 +240,9 @@@ export const useChat = () =>
const builder = new CompletionMessagesBuilder(
messages,
- currentAssistant?.instructions
+ renderInstructions(currentAssistant?.instructions)
)
- if (troubleshooting) builder.addUserMessage(message)
+ if (troubleshooting) builder.addUserMessage(message, attachments)
let isCompleted = false
diff --cc web-app/src/locales/de-DE/assistants.json
index 4cc1f047c,d1c5ce749..2b191ca59
--- a/web-app/src/locales/de-DE/assistants.json
+++ b/web-app/src/locales/de-DE/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "Neuen Assistenten anlegen",
"personality": "Persönlichkeit",
"capabilities": "Fähigkeiten",
- "instructionsDateHint": "Tipp: Verwenden Sie {{current_date}}, um das heutige Datum einzufügen."
++ "instructionsDateHint": "Tipp: Verwenden Sie {{current_date}}, um das heutige Datum einzufügen.",
+ "maxToolSteps": "Maximale Werkzeugschritte"
}
diff --cc web-app/src/locales/en/assistants.json
index bf4e2a36e,8f3f6ee14..174d9dec7
--- a/web-app/src/locales/en/assistants.json
+++ b/web-app/src/locales/en/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "Create New Assistant",
"personality": "Personality",
"capabilities": "Capabilities",
- "instructionsDateHint": "Tip: Use {{current_date}} to insert today’s date."
++ "instructionsDateHint": "Tip: Use {{current_date}} to insert today’s date.",
+ "maxToolSteps": "Max tool steps"
}
diff --cc web-app/src/locales/id/assistants.json
index 994c852db,233aeff54..64fd680ff
--- a/web-app/src/locales/id/assistants.json
+++ b/web-app/src/locales/id/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "Buat Asisten Baru",
"personality": "Kepribadian",
"capabilities": "Kemampuan",
- "instructionsDateHint": "Tips: Gunakan {{current_date}} untuk menyisipkan tanggal hari ini."
++ "instructionsDateHint": "Tips: Gunakan {{current_date}} untuk menyisipkan tanggal hari ini.",
+ "maxToolSteps": "Langkah alat maksimum"
}
diff --cc web-app/src/locales/vn/assistants.json
index 94fef8b1b,ead588649..c4f2e6160
--- a/web-app/src/locales/vn/assistants.json
+++ b/web-app/src/locales/vn/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "Tạo Trợ lý Mới",
"personality": "Tính cách",
"capabilities": "Khả năng",
- "instructionsDateHint": "Mẹo: Dùng {{current_date}} để chèn ngày hôm nay."
++ "instructionsDateHint": "Mẹo: Dùng {{current_date}} để chèn ngày hôm nay.",
+ "maxToolSteps": "Bước tối đa của công cụ"
}
diff --cc web-app/src/locales/zh-CN/assistants.json
index f81e2dbc2,57648c92e..520fc584e
--- a/web-app/src/locales/zh-CN/assistants.json
+++ b/web-app/src/locales/zh-CN/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "创建新助手",
"personality": "个性",
"capabilities": "能力",
- "instructionsDateHint": "提示:使用 {{current_date}} 插入今天的日期。"
++ "instructionsDateHint": "提示:使用 {{current_date}} 插入今天的日期。",
+ "maxToolSteps": "最大工具步骤"
}
diff --cc web-app/src/locales/zh-TW/assistants.json
index 69b6605d9,4eaf764df..6c7d19696
--- a/web-app/src/locales/zh-TW/assistants.json
+++ b/web-app/src/locales/zh-TW/assistants.json
@@@ -30,5 -30,5 +30,6 @@@
"createNew": "建立新助理",
"personality": "個性",
"capabilities": "能力",
- "instructionsDateHint": "提示:使用 {{current_date}} 插入今天的日期。"
++ "instructionsDateHint": "提示:使用 {{current_date}} 插入今天的日期。",
+ "maxToolSteps": "最大工具步驟"
}