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

In cymbal_ingest_to_vector_database_all_steps.txt main.py there is an error occurring "Unable to find your project. Please provide a project ID by" #1

Open
Maheshkanhere opened this issue Dec 11, 2024 · 1 comment

Comments

@Maheshkanhere
Copy link

Maheshkanhere commented Dec 11, 2024

Even though I've replaced my project id in main.py it's throwing below error:

raceback (most recent call last):
File "/home/student_01_288500eb966c/gen-ai-assessment/main.py", line 35, in
embedding_model = VertexAIEmbeddings(model_name="text-embedding-004")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student_01_288500eb966c/.local/lib/python3.12/site-packages/langchain_google_vertexai/embeddings.py", line 150, in init
super().init(
File "/usr/local/lib/python3.12/dist-packages/pydantic/main.py", line 209, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for VertexAIEmbeddings
Value error, Unable to find your project. Please provide a project ID by:
Passing a constructor argument
Using vertexai.init()
Setting project using 'gcloud config set project my-project'
Setting a GCP environment variable
To create a Google Cloud project, please follow guidance at https://developers.google.com/workspace/guides/create-project [type=value_error, input_value={'project': None, 'locati... 'default_metadata': ()}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/value_error
Waiting up to 5 seconds.
Sent all pending logs.

Then I tried providing project id as a param to VertexAIEmbeddings() then it's giving err 403:permission denied.

@puranjay123
Copy link

puranjay123 commented Dec 17, 2024

There are two possible issues that can occur this

  1. Either you are not using credentials provided by GCP and using your personal account.
  2. You didn't set the correct project as the current working project see the below code to set the project
`Authenticate with GCP (if not already authenticated):


gcloud auth login
Set the project ID:


gcloud config set project [PROJECT_ID]
Replace [PROJECT_ID] with the desired project ID.

Verify the project is set:


gcloud config get-value project`

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

2 participants