504 Deadline Exceeded while using langchain_google_genai

Exception in thread django-main-thread:
Traceback (most recent call last):
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_google_genai/embeddings.py”, line 146, in embed_documents
result = self.client.batch_embed_contents(
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/ai/generativelanguage_v1beta/services/generative_service/client.py”, line 1350, in batch_embed_contents
response = rpc(
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/gapic_v1/method.py”, line 131, in call
return wrapped_func(*args, **kwargs)
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/retry/retry_unary.py”, line 293, in retry_wrapped_func
return retry_target(
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/retry/retry_unary.py”, line 153, in retry_target
_retry_error_helper(
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/retry/retry_base.py”, line 212, in _retry_error_helper
raise final_exc from source_exc
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/retry/retry_unary.py”, line 144, in retry_target
result = target()
File “/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/google/api_core/timeout.py”, line 120, in func_with_timeout
return func(*args, **kwargs)
File “/Users/dhvanipatel/Library/Python/3.9/li

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>b/python/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/django_chatbot/urls.py", line 21, in <module>
path('', include('chatbot.urls'))
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/urls.py", line 2, in <module>
from . import views
File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/views.py", line 13, in <module>
GptEngineobj = GptSqlEngine()
File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/GptSqlEngine.py", line 76, in __init__
self.getSimQAndSQL()
File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/GptSqlEngine.py", line 251, in getSimQAndSQL
vecotorDoc = Chroma.from_documents(documents=documents_nltosql, embedding=embeddings)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 778, in from_documents
return cls.from_texts(
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 736, in from_texts
chroma_collection.add_texts(
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 275, in add_texts
embeddings = self._embedding_function.embed_documents(texts)
File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_google_genai/embeddings.py", line 150, in embed_documents
** raise GoogleGenerativeAIError(f"Error embedding content: {e}") from e
langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: 504 Deadline Exceeded
**
This is my error. Can anybody please help me to slove this error.
Tried to use different dependecies version.
Check network bandwidth
Tired to reboot whole laptop
</code>
<code>b/python/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/base.py", line 485, in check all_issues = checks.run_checks( File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 494, in check for pattern in self.url_patterns: File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/django_chatbot/urls.py", line 21, in <module> path('', include('chatbot.urls')) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/conf.py", line 38, in include urlconf_module = import_module(urlconf_module) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/urls.py", line 2, in <module> from . import views File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/views.py", line 13, in <module> GptEngineobj = GptSqlEngine() File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/GptSqlEngine.py", line 76, in __init__ self.getSimQAndSQL() File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery 2.2(Role Base)/chatbot/GptSqlEngine.py", line 251, in getSimQAndSQL vecotorDoc = Chroma.from_documents(documents=documents_nltosql, embedding=embeddings) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 778, in from_documents return cls.from_texts( File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 736, in from_texts chroma_collection.add_texts( File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 275, in add_texts embeddings = self._embedding_function.embed_documents(texts) File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_google_genai/embeddings.py", line 150, in embed_documents ** raise GoogleGenerativeAIError(f"Error embedding content: {e}") from e langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: 504 Deadline Exceeded ** This is my error. Can anybody please help me to slove this error. Tried to use different dependecies version. Check network bandwidth Tired to reboot whole laptop </code>
b/python/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
    raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded

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

Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run
    self.check(display_num_errors=True)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/management/base.py", line 485, in check
    all_issues = checks.run_checks(
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    return check_method()
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 494, in check
    for pattern in self.url_patterns:
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 715, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
    return import_module(self.urlconf_name)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery  2.2(Role Base)/django_chatbot/urls.py", line 21, in <module>
    path('', include('chatbot.urls'))
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/django/urls/conf.py", line 38, in include
    urlconf_module = import_module(urlconf_module)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery  2.2(Role Base)/chatbot/urls.py", line 2, in <module>
    from . import views
  File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery  2.2(Role Base)/chatbot/views.py", line 13, in <module>
    GptEngineobj =  GptSqlEngine()
  File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery  2.2(Role Base)/chatbot/GptSqlEngine.py", line 76, in __init__
    self.getSimQAndSQL()
  File "/Users/dhvanipatel/Downloads/GEN-AI-BRM-Assistant_VertexAI_Bquery  2.2(Role Base)/chatbot/GptSqlEngine.py", line 251, in getSimQAndSQL
    vecotorDoc = Chroma.from_documents(documents=documents_nltosql, embedding=embeddings)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 778, in from_documents
    return cls.from_texts(
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 736, in from_texts
    chroma_collection.add_texts(
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_community/vectorstores/chroma.py", line 275, in add_texts
    embeddings = self._embedding_function.embed_documents(texts)
  File "/Users/dhvanipatel/Library/Python/3.9/lib/python/site-packages/langchain_google_genai/embeddings.py", line 150, in embed_documents
   ** raise GoogleGenerativeAIError(f"Error embedding content: {e}") from e
langchain_google_genai._common.GoogleGenerativeAIError: Error embedding content: 504 Deadline Exceeded
**



This is my error. Can anybody please help me to slove this error.


Tried to use different dependecies version. 
Check network bandwidth
Tired to reboot whole laptop

New contributor

Dhvani Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật