ItzCrazyKns/Perplexica

Error: Unhandled Rejection at: [object Promise], reason: TypeError: Cannot read properties of undefined (reading 'indexOf')

YasKur opened this issue · 6 comments

Hey.

I init project from instruction - CONTRIBUTING.md.

And after send search - ask somthing - have this error:

Error: Unhandled Rejection at: [object Promise], reason: TypeError: Cannot read properties of undefined (reading 'indexOf')

error

Can you provide more details, what model are you using?

Can you provide more details, what model are you using?

model

This generally happens when the model isn't giving the output perfectly, can you provide more details on what action did you perform what are the logs from the browser console and overall logs from the backend.

This generally happens when the model isn't giving the output perfectly, can you provide more details on what action did you perform what are the logs from the browser console and overall logs from the backend.

Hm, mb this is problem with my node version - i try - node -v v18.20.5, but have error. When install backend -

npm install:

npm error command failed
npm error command sh -c prebuild-install || node-gyp rebuild --release
npm error TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm error   LIBTOOL-STATIC Release/sqlite3.a
npm error   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm error rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error prebuild-install warn install No prebuilt binaries found (target=18.20.5 runtime=node arch=x64 libc= platform=darwin)
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@18.20.5 | darwin | x64
npm error gyp info find Python using Python version 3.13.0 found at

Mb conflict deps better-sqlite3.

If i use - npm install better-sqlite3 all installed. But version not 11.0.0.

Because if i try use this code, its works fine -

const chat = new ChatOpenAI(
      { temperature: 0, openAIApiKey: openAIApiKey },
  );

  try {
    const response = await chat.invoke(['hello']);
    console.log(response);
  } catch (e) {
    console.log(e);
  }

npm install - backend

package.json updated:
"better-sqlite3": "^11.6.0",

src/agents/webSearchAgent.ts
RunnableLambda.from(async (input: string) => { -> input = undefined, i dont know why(

Fixed