googleapis / googleapis/python-aiplatform
`text` definition have logic problem in the `class GenerationResponse`
- Langage dominant
- Python
- Étoiles
- 905
- Forks
- 465
- Merge moyen
- 1 j 13 h
- PR mergées (30 j)
- 44
Description
Thanks for stopping by to let us know something could be better!
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
- Search the issues already opened: https://github.com/googleapis/python-aiplatform/issues
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
If you are still having issues, please be sure to include as much information as possible:
#### Environment details
- OS type and version: Debian GNU/Linux forky/sid
- Python version: 3.12.10
- pip version: 25.0.1
- `google-cloud-aiplatform` version: 1.132.0
#### Steps to reproduce
1. run `https://github.com/GoogleCloudPlatform/applied-ai-engineering-samples/blob/main/genai-on-vertex-ai/gemini/prompting_recipes/pdf_processing/1_extract_pdf_pages_with_gemini.ipynb`
#### Code example
In the `1_extract_pdf_pages_with_gemini.ipynb`:
```python
with open(pdf_path, "rb") as f:
pdf_bytes = f.read()
pages = pdf_pages(question=question, pdf_bytes=pdf_bytes)
print(pages)
```
#### Stack trace
```
Traceback (most recent call last):
File "/mnt/e/workspace/github.com/anlexN/applied-ai-engineering-samples/genai-on-vertex-ai/gemini/prompting_recipes/pdf_processing/untitled.py", line 162, in
pages = pdf_pages(question=question, pdf_bytes=pdf_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/e/workspace/github.com/anlexN/applied-ai-engineering-samples/genai-on-vertex-ai/gemini/prompting_recipes/pdf_processing/untitled.py", line 147, in pdf_pages
output_json = json.loads(responses.text)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anlexn/.pyenv/versions/3.12.10/lib/python3.12/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anlexn/.pyenv/versions/3.12.10/lib/python3.12/json/decoder.py", line 338, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anlexn/.pyenv/versions/3.12.10/lib/python3.12/json/decoder.py", line 356, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```
I have opened [**pull request**](https://github.com/googleapis/python-aiplatform/pull/6217), please review.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.