Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many pages in PDF Your Free plan supports up to 5 pages per PDF #2

Open
masapasa opened this issue Sep 30, 2023 · 40 comments
Open

Comments

@masapasa
Copy link

I just uploaded one pdf file with one page. Can you please help me. Thanks a lot!

@johanguse
Copy link

Did you change the Pinecone region? Maybe 'us-east1-gcp' is different to you... take a look at Pinecone account

Pinecone Client Instantiation - src/lib/pinecone.ts

import { PineconeClient } from '@pinecone-database/pinecone'

export const getPineconeClient = async () => {
  const client = new PineconeClient()

  await client.init({
    apiKey: process.env.PINECONE_API_KEY!,
    environment: 'us-east1-gcp',
  })

  return client
}

@Kumar-Sahani
Copy link

Kumar-Sahani commented Oct 4, 2023

Here's how I fixed this issue:

Go to your pinecone project (https://app.pinecone.io/)
Delete the api key,
Delete the index,
Delete the organisation

And now you have to create a new project then a new index(copy and save the environment value) and finally generate an api key

in your project go to src/lib/pinecone.ts and paste the environment value

also check if your openAI key hasn't expired, if expired generate a new key with another account

Save and run

@akshat-OwO
Copy link

just add '-free' in the environment string it fixed for me. I am using non deprecated code as well.

import { Pinecone } from '@pinecone-database/pinecone';

export const pinecone = new Pinecone({
    apiKey: process.env.PINECONE_API_KEY!,
    environment: 'asia-southeast1-gcp-free',
});

@Jay21105545
Copy link

Jay21105545 commented Oct 6, 2023

My error is still not going and pinecone is showing me environment "gcp-starter" and it's still throwing me this error
⚠ ./src/app/api/uploadthing/core.ts Attempted import error: 'getPineconeClient' is not exported from '@/lib/pinecone' (imported as 'getPineconeClient'). @akshat-OwO and also do i need gpt-4 upgrade in my open ai account ?

@akshat-OwO
Copy link

@Jay21105545 you are using old deprecated syntax which josh used in the video. Don't use it simply use the code which i provided above in pinecone.ts

and in core.ts or anywhere you use

import { getPineconeClient } from '@/lib/pinecone'

replace it with

import { pinecone } from '@/lib/pinecone';

also no need to write

const pinecone = await getPineconeClient()

for model i am using gpt-3.5-turbo-16k

@anand-mukul
Copy link

anand-mukul commented Oct 7, 2023

path: \src\lib\pinecone.ts

import { PineconeClient } from '@pinecone-database/pinecone'

  export const getPineconeClient = async () => {
    const client = new PineconeClient()
  
    await client.init({
      apiKey: process.env.PINECONE_API_KEY!,
      environment: 'asia-southeast1-gcp-free', // Verify your environment from pinecone website 
    })
  
    return client
  }

Check your pinecone website for environment

Verify with path : \src\app\api\message\route.ts AND \src\app\api\uploadthing\core.ts

// 1: vectorize message
  const embeddings = new OpenAIEmbeddings({
    openAIApiKey: process.env.OPENAI_API_KEY,
  })

  const pinecone = await getPineconeClient()  //Check this line in route.ts and core.ts
  const pineconeIndex = pinecone.Index('YourIndexName')

  const vectorStore = await PineconeStore.fromExistingIndex(
    embeddings,
    {
       //@ts-ignore
      pineconeIndex,
      namespace: file.id,
    }
  )

BONUS: Make sure that your Stripe Webhook and API are in test mode and add it to .env

@anand-mukul
Copy link

My error is still not going and pinecone is showing me environment "gcp-starter" and it's still throwing me this error ⚠ ./src/app/api/uploadthing/core.ts Attempted import error: 'getPineconeClient' is not exported from '@/lib/pinecone' (imported as 'getPineconeClient'). @akshat-OwO and also do i need gpt-4 upgrade in my open ai account ?

Follow this step on Pinecone:

  1. Delete your Index,
  2. Delete Your Organization and,
  3. Create new Organization and Index .

And, You're all Good! 👋

@Jay21105545
Copy link

Jay21105545 commented Oct 7, 2023

Hello @anand-mukul @akshat-OwO still im getting error here is my both file
core.ts and route.ts
CORE.TS
corets
ROUTE.TS
routets

@anand-mukul
Copy link

anand-mukul commented Oct 8, 2023 via email

@Jay21105545
Copy link

Jay21105545 commented Oct 10, 2023

Brother This is the error im facing @anand-mukul
Screenshot 2023-10-11 at 1 14 28 AM

@anand-mukul
Copy link

@Jay21105545 import { pinecone } from '@/lib/pinecone'

 const vectorStore = await PineconeStore.fromExistingIndex(embeddings, {
    //@ts-ignore
    pineconeIndex,
    namespace: file.id,
  });

@Jay21105545
Copy link

brother @anand-mukul it's now i think stuck on "Processing PDF..." first it's showing me "Processing PDF..." then it's showing me after loading Too many pages in PDF error again do you have your repo ? can you share it with me ?
image

@anand-mukul
Copy link

@Jay21105545
Okay, Check this out https://github.com/anand-mukul/PDFNinja

@Jay21105545
Copy link

@anand-mukul hello brother I'm still getting same error i have clone'd your repo and this is my repo can you pls check the error "https://github.com/Jay21105545/pdfff.git" and this my dashboard of pinecone
image

@anand-mukul
Copy link

anand-mukul commented Oct 13, 2023

@Jay21105545 First, Fix this in src/lib/utils.ts for deployed version
Line : 9

export function absoluteUrl(path: string) {
  return `https://pdfff.vercel.app/${path}`
}

And, Please change Index name in route.ts and core.ts with your own

@Jay21105545
Copy link

Jay21105545 commented Oct 13, 2023

i have fixed it brother pls check it now @anand-mukul but still the "Too many pages in PDF" is showing and checkout button is also not working :(
sorry brother i was also changing according to your instruction i forgoted to reply it :(

@anand-mukul
Copy link

anand-mukul commented Oct 13, 2023

My error is still not going and pinecone is showing me environment "gcp-starter" and it's still throwing me this error ⚠ ./src/app/api/uploadthing/core.ts Attempted import error: 'getPineconeClient' is not exported from '@/lib/pinecone' (imported as 'getPineconeClient'). @akshat-OwO and also do i need gpt-4 upgrade in my open ai account ?

Follow this step on Pinecone:

  1. Delete your Index,
  2. Delete Your Organization and,
  3. Create new Organization and Index .

And, You're all Good! 👋

@Jay21105545 Try this And Follow the video for Stripe setup.

@Jay21105545
Copy link

Jay21105545 commented Oct 13, 2023

thank's brother @anand-mukul the error of page is solved but now when i ask question my message is getting delivered but there is no response from open ai ?

@atilla-the-hun
Copy link

I can feel your frustration bud. I'm going to help you out because I had exactly the same issue until I remembered that some projects for some unknown reason only work once deployed to Vercel and not on your localhost. All you have to do is use Josh's original repo. It works fine. Just remember to change the pinecone environment and index name in the files before deployment to your own repo. Follow his deployment instructions from deployment preview bookmarked on his Youtube tutorial to deploy to Vercel. You will keep getting all these errors on localhost. Vercel is more advanced with their production build. The technology Vercel is using is very good. Give it a go and I'm sure everything will work, but remember to follow Josh's deployment instructions to the T.

@anand-mukul
Copy link

@atilla-the-hun I have checked your deployed version and it's not working. Even that doesn't have access to uploaded PDF. Please review your code.

@atilla-the-hun
Copy link

@anand-makul Strange it's not working for you. Just logged in and checked from 2 different devices. Everything is working A-okay. Accessed from a laptop (Windows) and a mobile (Android). No problems. Everything is working 100%. I'll test from a friend's device who lives in a different suburb and see if he has any problem with it.

@atilla-the-hun
Copy link

quill

Proof it's working

@atilla-the-hun
Copy link

Tested from another mobile device. Here's what I found: The uploading section where you drop a file or click to upload a file, duplicates itself and places another upload area overlapping the previous 1. Try selecting the same file twice i.e. that is by selecting a file and uploading it once with the first file upload and then the other. Don't close the other upload dialog or prompt. It seems like there's a duplicate in this part in the codebase and the focus remains on the first upload dialog/prompt that is opened. If you select with the first prompt and close the second, it won't upload. Still works, it's just that the duplication in the code has to be fixed.

@rishav887
Copy link

my messages are populating partially and then getting deleted when on vercel. Any one facing this ?

@GodwinAdu
Copy link

Hello please help, the fetch in the try block don't, at core.ts, here are the error im getting
Error in the try block: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11522:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (node:internal/deps/undici/undici:8472:28)
at node:internal/deps/undici/undici:8430:50
at Immediate._onImmediate (node:internal/deps/undici/undici:8459:37)
at process.processImmediate (node:internal/timers:478:21)
at process.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
}
the error is from the @/app/uploadthing/core.ts the fetch in the try block dont work and i dont know what to do again. i hope you can help me that please thank you

@Sahil-pvt
Copy link

Sahil-pvt commented Nov 6, 2023

Guys just see this please.... https://github.com/joschan21/quill/issues/38#issue-1979456973

@Suksham-sharma
Copy link

Suksham-sharma commented Nov 17, 2023

image image image image , I did everything as mentioned , can someone help me out @akshat-OwO @anand-mukul

@Sahil-pvt
Copy link

image image image image , I did everything as mentioned , can someone help me out @akshat-OwO @anand-mukul

Remove namespace (Refer: https://github.com/Sahil-pvt/PDFAskMate/blob/master/src/app/api/uploadthing/core.ts)

@JasonMKY
Copy link

Tested from another mobile device. Here's what I found: The uploading section where you drop a file or click to upload a file, duplicates itself and places another upload area overlapping the previous 1. Try selecting the same file twice i.e. that is by selecting a file and uploading it once with the first file upload and then the other. Don't close the other upload dialog or prompt. It seems like there's a duplicate in this part in the codebase and the focus remains on the first upload dialog/prompt that is opened. If you select with the first prompt and close the second, it won't upload. Still works, it's just that the duplication in the code has to be fixed.

Yeah I'm getting this issue also...

@gunjeetbawa10
Copy link

I am getting same error. please help me out like i tried removing namespace too @Sahil-pvt , Help me out

@gunjeetbawa10
Copy link

gunjeetbawa10 commented Nov 22, 2023

Screenshot 2023-11-22 at 5 09 04 PM

What location should i enter ?

@Teegreat
Copy link

No fix yet? @joschan21 please kindly help us out.

@Omsoni06
Copy link

Omsoni06 commented Jan 20, 2024

bro I am frustated with this error 😭😭

finally error solved

@Sujan1714
Copy link

bro I am frustated with this error 😭😭

finally error solved

Bro how

@baghelkunalpal
Copy link

where i fine the pinecone environment
image
Uploading image.png…
deprecation error like

@baghelkunalpal
Copy link

where i fine the pinecone environment
image
image
deprecation error like

@baghelkunalpal
Copy link

@anand-mukul can you help me resolve some errors my application one of the major stripe and also im not able to chat with our pdf im not able to write also in strip there is an probelm
image

@anand-mukul
Copy link

Hi @baghelkunalpal,

Thanks for reaching out! It seems like there have been significant updates since this project was initiated, including changes in versions, policies, and codes. To resolve the issue with your Stripe account, I recommend adjusting your business location in the Stripe settings. As for the code, you can refer to the following link for guidance: PDFNinja.

Feel free to let me know if you need further assistance!

Good Luck

@baghelkunalpal
Copy link

baghelkunalpal commented Apr 15, 2024 via email

@Sujan1714
Copy link

Broo iam also facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests