Comments (13)
@schnee, Thank you reporting this issue. "500 An internal error has occurred" error looks like an intermittent error and should work now.
This repository is for issues related to Gemini Python SDK bugs or improvements. For issues for feature requests related to Gemini API, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below.
from generative-ai-python.
@singhniraj08 Thank you. For being intermittent, it happens to me every time, including 2 minutes ago. Can you share the MP4 you used to validate that it works for you?
I have ported over to the VertexAI Python SDK and am able to use it to process the same test case video.
from generative-ai-python.
We only announced video support in the API+SDK today, it's probably wasn't active when you tried it. Try again?
from generative-ai-python.
Thank you @MarkDaoust
I updated to google-ai-generativelanguage-0.6.3 google-generativeai-0.5.3
and am getting another error now.
But you answered my base question: did the SDK support video, and the answer was no. This issue can be closed. And I'll research the below stack trace and possibly open another ticket.
Traceback (most recent call last):
File "/Users//projects//github/bw-impossible/creative_kitchen/mre.py", line 25, in <module>
response = model.generate_content([prompt_part, asset_part],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/generativeai/generative_models.py", line 262, in generate_content
response = self._client.generate_content(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/ai/generativelanguage_v1beta/services/generative_service/client.py", line 812, in generate_content
response = rpc(
^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
return wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 293, in retry_wrapped_func
return retry_target(
^^^^^^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 153, in retry_target
_retry_error_helper(
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/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 "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/api_core/retry/retry_unary.py", line 144, in retry_target
result = target()
^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/lib/python3.11/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users//Library/Caches/pypoetry/virtualenvs/bw-impossible-_xsmYHYG-py3.11/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.InvalidArgument: 400 * GenerateContentRequest.generation_config.response_schema.type: field predicate failed: $ != TYPE_UNSPECIFIED
from generative-ai-python.
Video works. Try the cookbook video tutorial: https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Video.ipynb
GenerateContentRequest.generation_config.response_schema.type: field predicate failed: $ != TYPE_UNSPECIFIED
That error is about the generation_config.response_schema
parameter. What did you pass it? I can't see in that paste.
from generative-ai-python.
@MarkDaoust - I literally updated the packages and reran the code from the top.
I'm good with someone (me?) closing this ticket, and I appreciate the pointers to make the code run.
from generative-ai-python.
@MarkDaoust - I literally updated the packages and reran the code from the top.
I'm good with someone (me?) closing this ticket, and I appreciate the pointers to make the code run.
You can close it yourself if you resolved the issue.
from generative-ai-python.
I encountered the error:
ValueError('The response.parts
quick accessor only works for a single candidate, but none were returned. Check the response.prompt_feedback
to see if the prompt was blocked.')
Has anyone encountered the same?
The video I uploaded was over 5 minutes long, here is my code:
safety_settings=[
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_NONE",
},
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "BLOCK_NONE",
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "BLOCK_NONE",
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_NONE",
},
]
video_file = genai.upload_file(path=filepath)
while video_file.state.name == "PROCESSING":
print('Waiting for video to be processed.')
time.sleep(10)
video_file_infos = genai.get_file(video_file.name)
if video_file_infos.state.name == "ACTIVE":
response = model.generate_content(['what is this?', video_file], safety_settings=safety_settings,
request_options={"timeout": 600})
genai.delete_file(video_file_infos.name)
return response
from generative-ai-python.
Try printing the response object that you got back.
from generative-ai-python.
Thanks for your reply.
This is the response object I got back:
from generative-ai-python.
I found out the reason. In my video which contains footage of creating a doll character, it started with creating body parts and clothes. So Google has determined that the video violates sexually.
Is there any way to fix it?
from generative-ai-python.
Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.
from generative-ai-python.
This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!
from generative-ai-python.
Related Issues (20)
- [email protected] HOT 1
- Inconsistency in how model name is supplied in the library. HOT 2
- 500 Internal Server Error when using gemini-1.5-pro model HOT 9
- Error when attempting to use Gemini 1.5 Pro: google.api_core.exceptions.InternalServerError: 500 An internal error has occurred HOT 4
- {www.donate.stripe.com/cash.app/$Ag42024 "custom_attribute_definition": { "key": "charity", "name": "Charitable Organization", "description": "Is this merchant a charitable organization with 501(c)(3) status?", "version": 1, "updated_at": "2023-01-20T02:41:37Z", "schema": { "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" }, "created_at": "2023-01-20T02:41:37Z", "visibility": "VISIBILITY_READ_WRITE_VALUES" } }
- g.dev/AustinRay-4031630597026839 content_copy HOT 1
- https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%5B%2214WQzOLiiz0dFKiVGQ2y3WQifZSdjW4ww%22%5D,%22action%22:%22open%22,%22userId%22:%22109116126150763630254%22,%22resourceKeys%22:%7B%7D%7D HOT 1
- Ag22 HOT 1
- Ag22
- Benefit to TrusteeType Benefit
- json mode outputs extra brackets or doesn't include HOT 9
- Get finish_reason: 6 without reason and content reply HOT 2
- Ag2279122/Workday www.githubstatus.com/?subscription_confirmed=Trustee HOT 2
- www.google.com/finance/portfolio/1f3be294-4e5a-496e-8453-9ca892029401?window=1 HOT 1
- 7314874656 HOT 2
- google.api_core.exceptions.InvalidArgument: 400 API key not valid. Please pass a valid API key. [reason: "API_KEY_INVALID" domain: "googleapis.com" metadata { key: "service" value: "generativelanguage.googleapis.com" } ] HOT 2
- Context Cache and updating Gemini Code Assist HOT 1
- WARNING: All log messages before absl::InitializeLog() is called are written to STDERR HOT 2
- 1.0 Release
- Missing stream=True Parameter in _StreamGenerateContent Class of GenerativeServiceRestTransport Causes Non-Streaming Requests HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generative-ai-python.