googleapis / googleapis/python-aiplatform
`text` definition have logic problem in the `class GenerationResponse`
- Ngôn ngữ chính
- Python
- Star
- 905
- Fork
- 465
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 44
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với genai-on-vertex-ai/gemini/prompting_recipes/pdf_processing/1_extract_pdf_pages_with_gemini.ipynb và tái hiện JSONDecodeError tại json.loads(responses.text). Sau đó, kiểm tra định nghĩa của GenerationResponse và pull request #6217 được liên kết; công việc được xem là hoàn tất khi notebook tạo ra một response có thể phân tích mà không gặp lỗi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, machine-learning
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100