Giter Site home page Giter Site logo
mint-jiraphinya photo

ai-jiraphinya Goto Github PK

followers: 2.0 following: 15.0 repos: 51.0 gists: 5.0

Name: mint-jiraphinya

Type: User

Bio: 🚩เหมือนฉันติดใน มิติ ควอนตัม มองไม่เห็นทางออก เป็นเพียงอนุภาคเล็กๆ ในจักรวาล

Location: ดาวอังคาร

Document Search By Mint

support/จ้างงาน FRONT END , BACK END: สนับสนุนทุนการศึกษา/ชานมเย็นสักแก้ว

บัญชีพี่มิว ปรีดิ์ปราโมทย์ เวชบุตร กสิกรไทย 110-8-25747-0
บัญชีเเม่ สุมาลี วงค์ศรีชา กสิกรไทย 121-3-84931-6 บัญชีเเม่
ส่งข้อความให้กำลังใจ หมายเลข 096-3346517 มิ้นน้อย

Deploy Netlify NoOPENAI_KEYNo AI

Netlify Status

Deploy OPENAI_KEY Build MySQL:Supabase Docs

This starter takes all the .mdx files in the pages directory and processes them to use as custom context within OpenAI Text Completion prompts. Deploy this starter to Vercel. The Supabase integration will automatically set the required environment variables and configure your Database Schema. All you have to do is set your OPENAI_KEY and you're ready to go!

Deploy with Vercel

Technical Details

Building your own custom ChatGPT involves four steps:

Authentication-Supabase

  1. [👷 Build time] Pre-process the knowledge base (your .mdx files in your pages folder).
  2. [👷 Build time] Store embeddings in Postgres with pgvector.
  3. [🏃 Runtime] Perform vector similarity search to find the content that's relevant to the question.
  4. [🏃 Runtime] Inject content into OpenAI GPT-3 text completion prompt and stream response to the client.

👷 Build time

Step 1. and 2. happen at build time, e.g. when Vercel builds your Next.js app. During this time the generate-embeddings script is being executed which performs the following tasks:

sequenceDiagram
    participant Vercel
    participant DB (pgvector)
    participant OpenAI (API)
    loop 1. Pre-process the knowledge base
        Vercel->>Vercel: Chunk .mdx pages into sections
        loop 2. Create & store embeddings
            Vercel->>OpenAI (API): create embedding for page section
            OpenAI (API)->>Vercel: embedding vector(1536)
            Vercel->>DB (pgvector): store embedding for page section
        end
    end

In addition to storing the embeddings, this script generates a checksum for each of your .mdx files and stores this in another database table to make sure the embeddings are only regenerated when the file has changed.

🏃 Runtime

Step 3. and 4. happen at runtime, anytime the user submits a question. When this happens, the following sequence of tasks is performed:

sequenceDiagram
    participant Client
    participant Edge Function
    participant DB (pgvector)
    participant OpenAI (API)
    Client->>Edge Function: { query: lorem ispum }
    critical 3. Perform vector similarity search
        Edge Function->>OpenAI (API): create embedding for query
        OpenAI (API)->>Edge Function: embedding vector(1536)
        Edge Function->>DB (pgvector): vector similarity search
        DB (pgvector)->>Edge Function: relevant docs content
    end
    critical 4. Inject content into prompt
        Edge Function->>OpenAI (API): completion request prompt: query + relevant docs content
        OpenAI (API)-->>Client: text/event-stream: completions response
    end

The relevant files for this are the SearchDialog (Client) component and the vector-search (Edge Function).

The initialization of the database, including the setup of the pgvector extension is stored in the supabase/migrations folder which is automatically applied to your local Postgres instance when running supabase start.

Local Development

Configuration

  • cp .env.example .env
  • Set your OPENAI_KEY in the newly created .env file.
  • Set NEXT_PUBLIC_SUPABASE_ANON_KEY and SUPABASE_SERVICE_ROLE_KEY run:

    Note: You have to run supabase to retrieve the keys.

Start Supabase

Make sure you have Docker installed and running locally. Then run

supabase start

To retrieve NEXT_PUBLIC_SUPABASE_ANON_KEY and SUPABASE_SERVICE_ROLE_KEY run:

supabase status

Start the Next.js App

In a new terminal window, run

pnpm dev

Using your custom .mdx docs

  1. By default your documentation will need to be in .mdx format. This can be done by renaming existing (or compatible) markdown .md file.
  2. Run pnpm run embeddings to regenerate embeddings.

    Note: Make sure supabase is running. To check, run supabase status. If is not running run supabase start.

  3. Run pnpm dev again to refresh NextJS localhost:3000 rendered page.

Learn More You need to find the video "Supabase" on YouTube.

I only have basic skills, so I might not be able to help you much.

Video: How I Built Supabase’s OpenAI Doc Search

Licence

Apache 2.0

จ้างงาน FRONT END , BACK END:

  • วิทยาศาสตร์ข้อมูล,เทรน,สร้าง Model เเบบกำหนดเอง ทั้ง Local,online,firebase aws tmbd-api movies
  • Bayesian Neural Network ฯ
  • เพราะไม่ใช่คนเก่งอะไร เพียงอยากเเสวงหาความรู้เเลกเปลี่ยน เเบ่งปัน ราคางาน เริ่มต้นจึงเเค่ 300 บาท

mint-jiraphinya's Projects

ai-gate icon ai-gate

AI Gate is a powerful desktop application that brings together a collection of top AI tools for your convenience. NO API key needed.

angular-movies icon angular-movies

เลิกผลิต หากต้องการ npm run nx run firebase-function:deploy-firebase && npm run nx run movies:deploy-firebase เเละแก้ .env

books icon books

📚 All programming languages books

chatbot icon chatbot

ใช้ได้ฟรี รับคีย์ที่หน้าเวบ

chatbot-ui-app icon chatbot-ui-app

Chatbot UI เป็นโคลนโอเพ่นซอร์สของ ChatGPT UI ของ OpenAI UI ของ Chatbot ช่วยให้คุณสามารถเสียบคีย์ API เพื่อใช้ UI นี้กับ API ได้ ใช้เพื่อสื่อสารกับ API เท่านั้น โปรดตั้งค่าคีย์ OpenAI API ของคุณที่ด้านล่างซ้ายของแถบด้านข้าง หากคุณไม่มีคีย์ OpenAI API คุณสามารถรับได้ที่นี่: openai.com

clone-wars icon clone-wars

100+ open-source clones of popular sites like Airbnb, Amazon, Instagram, Netflix, Tiktok, Spotify, Whatsapp, Youtube etc. See source code, demo links, tech stack, github stars.

composecookbook icon composecookbook

A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential

customchar icon customchar

Your customized AI characters - personal assistants on any hardware! With llama.cpp, whisper.cpp, ggml, LLaMA-v2.

dliver icon dliver

Front-end Ember-CLI App for dLiver

document-search icon document-search

เเค่สนามเด็กเล่น. อย่าได้ถือสาหาความ, การเขียนภาษาอื่นอาจผิดบ้าง. เพราะฉันใช้ภาษาไทย!

ebooks icon ebooks

รวมรายการหนังสือ ภาษาอังกฤษ

ecommerce icon ecommerce

We're going to take you step-by-step to build a modern, fully open-source, eCommerce web application using Python, Django, Bootstrap, Javascript, and more.

google-bard-electron icon google-bard-electron

An unofficial desktop app for Google Bard, supports all desktop platforms including Windows, Linux & macOS.

hackgpt icon hackgpt

I leverage OpenAI and ChatGPT to do hackerish things

hulu icon hulu

Hulu downloader written in Go

jamstack-blog-starter icon jamstack-blog-starter

Filler content for the DevProjects challenge Create a fast and secure blog using JAMStack, so you can get started without worrying about having content.

jiraphinya-ai-ui icon jiraphinya-ai-ui

รวมเครื่องมือ สร้าง Ai: มิ้น จิรภิญญา เวชบุตร

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.