jan/web/screens/Chat/SimpleTextMessage/RelativeImage.tsx
hiro e6c10202e0
feat: Jan can see (#2069)
* feat: jan can see

feat: Add GPT-4 Vision model (Preview)

fix: Add visionModel as property in ModelInfo

fix: Fix condition to load local messages in useSetActiveThread hook

feat: Enable Image as input for chat

fix: Update model parameters in JSON files for remote GPT models

fix: Add thread as optional

fix: Add support for message as image

fix: Linter

fix: Update proxyModel to proxy_model and add textModel

chore: Change proxyModel to proxy_model

fix: Update settings with visionModel and textModel

fix: vision model passed through the retrieval tool

fix: linter

* fix: could not load image and request is not able to be sent

---------

Co-authored-by: Louis <louis@jan.ai>
2024-03-05 08:33:09 +07:00

31 lines
608 B
TypeScript

import { useEffect, useState } from 'react'
import { getJanDataFolderPath } from '@janhq/core'
export const RelativeImage = ({
id,
src,
onClick,
}: {
id: string
src: string
onClick: () => void
}) => {
const [path, setPath] = useState<string>('')
useEffect(() => {
getJanDataFolderPath().then((dataFolderPath) => {
setPath(dataFolderPath)
})
}, [])
return (
<button onClick={onClick}>
<img
className="aspect-auto h-[300px] cursor-pointer"
alt={id}
src={src.includes('files/') ? `file://${path}/${src}` : src}
/>
</button>
)
}