Echoshard / Gemini_Discordbot

A Gemini Discord bot that can accept images and has conversation memory
MIT License
67 stars 38 forks source link

Bot not reply when ask him. #12

Closed Beterng closed 5 months ago

Beterng commented 5 months ago

I call name bot in discord chat. @Demo Bot - Python 1 + 1 =? It being typ[ing but it so long.

It's a log.


Gemini Bot Logged in as Demo Bot - Python#0329

New Message FROM:890409289049587782: 1 + 1 = Got textPrompt: 1 + 1 = 2024-03-26 09:10:38 ERROR discord.client Ignoring exception in on_message Traceback (most recent call last): File "/home/container/.local/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event await coro(*args, kwargs) File "/home/container/app.py", line 222, in on_message response_text = await generate_response_with_text(cleaned_text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/app.py", line 239, in generate_response_with_text response = text_model.generate_content(prompt_parts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/generativeai/generative_models.py", line 232, in generate_content response = self._client.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/ai/generativelanguage_v1beta/services/generative_service/client.py", line 566, in generate_content response = rpc( ^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/api_core/gapic_v1/method.py", line 131, in call return wrapped_func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 293, in retry_wrapped_func return retry_target( ^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 153, in retry_target _retry_error_helper( File "/home/container/.local/lib/python3.11/site-packages/google/api_core/retry/retry_base.py", line 212, in _retry_error_helper raise final_exc from source_exc File "/home/container/.local/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 144, in retry_target result = target() ^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/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.FailedPrecondition: 400 User location is not supported for the API use.

Echoshard commented 5 months ago

Say's there right at the bottom google.api_core.exceptions.FailedPrecondition: 400 User location is not supported for the API use.

https://ai.google.dev/available_regions It's a google limitation no way around it unless you run via a VPN. I assume your somewhere in Europe where they are not supported.

Beterng commented 5 months ago

Thank you. It working.