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
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
Dhvani Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.