Merge branch 'docs/api-reference' of https://github.com/janhq/jan into docs/api-reference
This commit is contained in:
commit
2b49072d30
@ -9,6 +9,7 @@ import { Button } from '@janhq/uikit'
|
||||
import { useAtomValue, useSetAtom } from 'jotai'
|
||||
import { RefreshCcw } from 'lucide-react'
|
||||
|
||||
import { useActiveModel } from '@/hooks/useActiveModel'
|
||||
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
||||
|
||||
import { extensionManager } from '@/extension'
|
||||
@ -16,6 +17,7 @@ import {
|
||||
deleteMessageAtom,
|
||||
getCurrentChatMessagesAtom,
|
||||
} from '@/helpers/atoms/ChatMessage.atom'
|
||||
import { totalRamAtom } from '@/helpers/atoms/SystemBar.atom'
|
||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||
|
||||
const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
@ -23,6 +25,8 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
const thread = useAtomValue(activeThreadAtom)
|
||||
const deleteMessage = useSetAtom(deleteMessageAtom)
|
||||
const { resendChatMessage } = useSendChatMessage()
|
||||
const { activeModel } = useActiveModel()
|
||||
const totalRam = useAtomValue(totalRamAtom)
|
||||
|
||||
const regenerateMessage = async () => {
|
||||
const lastMessageIndex = messages.length - 1
|
||||
@ -66,24 +70,33 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
{message.status === MessageStatus.Error && (
|
||||
<div key={message.id} className="mt-10 flex flex-col items-center">
|
||||
<span className="mb-3 text-center text-sm font-medium text-gray-500">
|
||||
<p>Apologies, something's amiss!</p>
|
||||
Jan's in beta. Find troubleshooting guides{' '}
|
||||
<a
|
||||
href="https://jan.ai/guides/troubleshooting"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
here
|
||||
</a>{' '}
|
||||
or reach out to us on{' '}
|
||||
<a
|
||||
href="https://discord.gg/AsJ8krTT3N"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
Discord
|
||||
</a>{' '}
|
||||
for assistance.
|
||||
{Number(activeModel?.metadata.size) > totalRam ? (
|
||||
<>
|
||||
Oops! Model size exceeds available RAM. Consider selecting a
|
||||
smaller model or upgrading your RAM for smoother performance.
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p>Apologies, something's amiss!</p>
|
||||
Jan's in beta. Find troubleshooting guides{' '}
|
||||
<a
|
||||
href="https://jan.ai/guides/troubleshooting"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
here
|
||||
</a>{' '}
|
||||
or reach out to us on{' '}
|
||||
<a
|
||||
href="https://discord.gg/AsJ8krTT3N"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
Discord
|
||||
</a>{' '}
|
||||
for assistance.
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -108,9 +108,7 @@ const LocalServerScreen = () => {
|
||||
window.core?.api?.stopServer()
|
||||
setServerEnabled(false)
|
||||
} else {
|
||||
if (!activeModel) {
|
||||
startModel(String(selectedModel?.id))
|
||||
}
|
||||
startModel(String(selectedModel?.id))
|
||||
window.core?.api?.startServer({
|
||||
host,
|
||||
port,
|
||||
@ -129,7 +127,7 @@ const LocalServerScreen = () => {
|
||||
</Button>
|
||||
{serverEnabled && (
|
||||
<Button block themes="secondaryBlue" asChild>
|
||||
<a href={`http://${host}:${port}`} target="_blank">
|
||||
<a href={`http://localhost:${port}`} target="_blank">
|
||||
API Reference <ExternalLinkIcon size={20} className="ml-2" />
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user