Giter Club home page Giter Club logo

Comments (15)

gregnr avatar gregnr commented on July 3, 2024 2

Hey @kiran-brahma - agreed we should update this with the newer chat-based models. In the mean time, you can see how we have done this on the official Supabase website here:

https://github.com/supabase/supabase/blob/e524c30dd88af8bf5054a7f296eac8bd9d73affb/supabase/functions/ai-docs/index.ts

from nextjs-openai-doc-search.

musashi-garami avatar musashi-garami commented on July 3, 2024 1

Really would love this template to be upgraded to gpt-3.5-turbo model!! That would be super cool.

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

Thanks @gregnr. Will see and try to understand if same can be done for my code base. Any expected timelines for a similar implementation for the current template.

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

Hello @gregnr I tried to replicate the code shared by you but I keep getting the error
Type error: Cannot find module 'import { serve } from 'https://deno.land/[email protected]/http/server.ts'' or its corresponding type declarations.

1 | import { serve } from 'https://deno.land/[email protected]/http/server.ts'';
| ^
2 | import '[email protected]/mod.ts'
3 | import { createClient } from '@supabase/supabase-js'
4 | import { codeBlock, oneLine } from 'common-tags'
 ELIFECYCLE  Command failed with exit code 1.
 Any idea on how to resolve as I managed to install local packages for others but unable for Deno

from nextjs-openai-doc-search.

gregnr avatar gregnr commented on July 3, 2024

Hey @kiran-brahma, confirming your error was copied over correctly? I see a double import:

1 | import { serve } from 'import { serve } from 'https://deno.land/[email protected]/http/server.ts'';

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

There was an error in the code I pasted. There is no double import and just a single one

from nextjs-openai-doc-search.

gregnr avatar gregnr commented on July 3, 2024

Is the error coming from your IDE or when you run the edge function? If IDE & VSCode, confirming you have the official Deno extension installed and the dependency has been cached?

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

I am getting the error when deploying it on vercel.

Including the error message I got after making another attempt today

Attention: Next.js now collects completely anonymous telemetry regarding usage.

This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
 

1 | import { serve } from "https://deno.land/[email protected]/http/server.ts";
| ^
2 | import 'x/[email protected]/mod.ts'
3 | import { createClient } from '@supabase/supabase-js'
4 | import { codeBlock, oneLine } from 'common-tags'
ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
Deployment completed
BUILD_UTILS_SPAWN_1: Command "pnpm run build" exited with 1

from nextjs-openai-doc-search.

gregnr avatar gregnr commented on July 3, 2024

Based on the path ./pages/api/vector-search.ts, it looks like you are placing your edge function in a Next.js serverless function instead of a Supabase edge function. If you are planning to use Supabase edge functions, you will need to place your edge function under the ./supabase/functions folder as described in this guide:
https://supabase.com/docs/guides/functions/quickstart

Supabase uses Deno for its edge runtime while Next.js uses Node.js (or their custom runtime for edge). This is most likely why you are getting the import error as imports work slightly different in Deno.

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

I shifted the edge functions to supabase and when I am trying to deploy the same on supabase I am getting the following error

Version 1.30.3 is already installed
Bundling ai-docs
Error: Error bundling function: exit status 1
file:///src/import_map.json
file:///src/index.ts
file:///common/errors
file:///common/tokenizer
error: Uncaught (in promise) Error: NotFound: No such file or directory (os error 2)
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/[email protected]/eszip_wasm.generated.js:513:19)
at (https://deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:1559899)
at (https://deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:1398157)
at (https://deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:1895031)
at __wbg_adapter_40 (https://deno.land/x/[email protected]/eszip_wasm.generated.js:229:6)
at real (https://deno.land/x/[email protected]/eszip_wasm.generated.js:213:14)

from nextjs-openai-doc-search.

thorwebdev avatar thorwebdev commented on July 3, 2024

@kiran-brahma can you please update your Supabase CLI version (e.g. brew upgrade supabase) and try again?

from nextjs-openai-doc-search.

kiran-brahma avatar kiran-brahma commented on July 3, 2024

hello @thorwebdev
Same issue persists even after the update

from nextjs-openai-doc-search.

thorwebdev avatar thorwebdev commented on July 3, 2024

What does supabase --version output for you? Maybe there's a caching issue. Might have to run brew update first and the brew upgrade supabase.

from nextjs-openai-doc-search.

gregnr avatar gregnr commented on July 3, 2024

If brew/scoop isn't getting you the latest version, you can also try the NPM approach as described here:
https://supabase.com/docs/guides/cli

from nextjs-openai-doc-search.

chartpath avatar chartpath commented on July 3, 2024

See my PR #34 which is what worked for me.

from nextjs-openai-doc-search.

Related Issues (20)

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.