supabase-community / nextjs-openai-doc-search

Template for building your own custom ChatGPT style doc search powered by Next.js, OpenAI, and Supabase.
https://supabase.com/blog/chatgpt-supabase-docs
Apache License 2.0
1.58k stars 280 forks source link

Reply with images #27

Closed musashi-garami closed 1 year ago

musashi-garami commented 1 year ago

Feature request

Being able to display actual markdown would be cool, nice to have image links in the docs mdx files, and then ask gpt to try include markdown image links where appropriate.

I can get GPT to include the ![Alt text](URL or file path) images, but the response isn't actually displaying markdown.

musashi-garami commented 1 year ago

Anyone have any luck with being able to do this ? I've tried getting the a,i to add the <img tag into it's replies, but it's still just text. Is this something that's possible?

gregnr commented 1 year ago

Hey @musashi-garami, agreed it would be great to support markdown in this project. In the mean time, feel free to check out how we do this in the Supabase docs/dashboard using ReactMarkdown:

https://github.com/supabase/supabase/blob/5d457bdc7567db9a73a02a3d10e984a641f6cc3d/packages/ui/src/components/Command/AiCommand.tsx#L418-L435

musashi-garami commented 1 year ago

Ok that looks perfect! But I'm struggling to install react-markdown. I normally use NPM but I see this builds with PNPM and vercel is not building, I'm assuming due to incorrect pnpm-lock.yaml file ? But I'm not experienced with PNPM, I installed latest PNPM, I tried to PNPM install react-markdown but didn't work.. so I NPM install react-markdown, but with my limited understanding it appears the pnpm-lock.yaml is not adding react-markdown as a dependency (which is failing the vercel build)

musashi-garami commented 1 year ago

Nevermind, looks like PNPM wasn't working in VS code terminal due to windows permissions, i ran in admin powershell and it installed properly.

Then another build error, was passing {completion} as a children prop to react-markdown (as their docs describe) but ESLint rules is not happy with that so passed {completion} between the react markdown tags