Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: 504 Deadline Exceeded #368

Description

@theripnono

Description of the bug:

I have the following error when :

gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001",google_api_key=gapiket) vector = gemini_embeddings.embed_query("hello, world!")

I've read that the API doesn't work depending on the country. Could this be the problem?

**Exception has occurred: GoogleGenerativeAIError

Error embedding content: 504 Deadline Exceeded
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.DEADLINE_EXCEEDED
	details = "Deadline Exceeded"
	debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2024-05-31T10:56:34.7789233+00:00", grpc_status:4, grpc_message:"Deadline Exceeded"}"
>

During handling of the above exception, another exception occurred:

google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded

The above exception was the direct cause of the following exception:

  File "C:\Users\drosset\Documents\intellicart\data\preprocess.py", line 28, in <module>
    vector = gemini_embeddings.embed_query("hello, world!")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: 504 Deadline Exceeded

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:python sdkIssue/PR related to Python SDKstatus:triagedIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions