fix: empty assistant instruction by default (#855)
* fix: empty assistant instruction by default * chore: there should be no error dialog for in-app update
This commit is contained in:
parent
27b62ed91a
commit
07fc1a91f3
@ -33,7 +33,6 @@ export function handleAppUpdates() {
|
||||
|
||||
/* App Update Error */
|
||||
autoUpdater.on("error", (info: any) => {
|
||||
dialog.showMessageBox({ message: info.message });
|
||||
WindowManager.instance.currentWindow?.webContents.send(
|
||||
"APP_UPDATE_ERROR",
|
||||
{}
|
||||
|
||||
@ -96,7 +96,7 @@ export default class JanAssistantExtension implements AssistantExtension {
|
||||
name: "Jan",
|
||||
description: "A default assistant that can use all downloaded models",
|
||||
model: "*",
|
||||
instructions: "Your name is Jan.",
|
||||
instructions: "",
|
||||
tools: undefined,
|
||||
file_ids: [],
|
||||
metadata: undefined,
|
||||
|
||||
@ -59,6 +59,7 @@ export default function useSendChatMessage() {
|
||||
const messages: ChatCompletionMessage[] = [
|
||||
activeThread.assistants[0]?.instructions,
|
||||
]
|
||||
.filter((e) => e && e.trim() !== '')
|
||||
.map<ChatCompletionMessage>((instructions) => {
|
||||
const systemMessage: ChatCompletionMessage = {
|
||||
role: ChatCompletionRole.System,
|
||||
@ -138,6 +139,7 @@ export default function useSendChatMessage() {
|
||||
const messages: ChatCompletionMessage[] = [
|
||||
activeThread.assistants[0]?.instructions,
|
||||
]
|
||||
.filter((e) => e && e.trim() !== '')
|
||||
.map<ChatCompletionMessage>((instructions) => {
|
||||
const systemMessage: ChatCompletionMessage = {
|
||||
role: ChatCompletionRole.System,
|
||||
|
||||
@ -13,13 +13,14 @@ import { twMerge } from 'tailwind-merge'
|
||||
|
||||
import { toaster } from '@/containers/Toast'
|
||||
|
||||
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
||||
|
||||
import { extensionManager } from '@/extension'
|
||||
import {
|
||||
deleteMessageAtom,
|
||||
getCurrentChatMessagesAtom,
|
||||
} from '@/helpers/atoms/ChatMessage.atom'
|
||||
import { activeThreadAtom } from '@/helpers/atoms/Conversation.atom'
|
||||
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
||||
|
||||
const MessageToolbar = ({ message }: { message: ThreadMessage }) => {
|
||||
const deleteMessage = useSetAtom(deleteMessageAtom)
|
||||
@ -82,12 +83,14 @@ const MessageToolbar = ({ message }: { message: ThreadMessage }) => {
|
||||
>
|
||||
<Copy size={14} />
|
||||
</div>
|
||||
<div
|
||||
className="cursor-pointer px-2 py-2 hover:bg-background/80"
|
||||
onClick={onDeleteClick}
|
||||
>
|
||||
<Trash2Icon size={14} />
|
||||
</div>
|
||||
{message.status === MessageStatus.Ready && (
|
||||
<div
|
||||
className="cursor-pointer px-2 py-2 hover:bg-background/80"
|
||||
onClick={onDeleteClick}
|
||||
>
|
||||
<Trash2Icon size={14} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user