The return value of the vector_stores.file_batches.poll method contains the ID of the VectorStore.
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Bắt đầu từ phương thức vector_stores.file_batches.poll và tái hiện hành vi bằng mã mẫu trong issue này. So sánh các trường id và object của đối tượng VectorStoreFileBatch được trả về với batch_obj; công việc được hoàn tất khi kết quả polling nhất quán biểu diễn file batch và trả về ID mong đợi của nó, kèm theo một regression test bao quát hành vi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
The expected result is that the file_batches object ID should be stored and returned.
To Reproduce
Run the sample code.
call poll method.
Code snippets
import openai
file_obj = None
vector_store_obj = None
try:
client = openai.OpenAI(
api_key=os.environ['OPENAI_API_KEY']
)
file_obj = client.files.create(file=('test_data.json', b'{"aa": "AA"}\n'), purpose='user_data')
vector_store_obj = client.vector_stores.create(name='test_vector_store')
batch_obj = client.vector_stores.file_batches.create(
vector_store_id=vector_store_obj.id,
file_ids=[file_obj.id]
)
print(f'type:[{type(batch_obj)}]')
print(batch_obj.model_dump_json(indent=2))
response = client.vector_stores.file_batches.poll(batch_id=batch_obj.id, vector_store_id=vector_store_obj.id)
print(f'type:[{type(response)}]')
print(response.model_dump_json(indent=2))
print("# The return value contains the vector_store id.")
print("# Shouldn't the return value of the file_batches.poll method be the batch_obj ID?")
print(f'# OpenAI version:[{openai.__version__}]')
finally:
if file_obj:
client.files.delete(file_id=file_obj.id)
if vector_store_obj:
client.vector_stores.delete(vector_store_id=vector_store_obj.id)
# Below are the execution results.
'''
type:[<class 'openai.types.vector_stores.vector_store_file_batch.VectorStoreFileBatch'>]
{
"id": "vsfb_ibj_6905db4e33dc81f4a789ad8df2b5c748",
"created_at": 1761991502,
"file_counts": {
"cancelled": 0,
"completed": 0,
"failed": 0,
"in_progress": 1,
"total": 1
},
"object": "vector_store.file_batch",
"status": "in_progress",
"vector_store_id": "vs_6905db4d53708191a75c5ef9979258fd"
}
type:[<class 'openai.types.vector_stores.vector_store_file_batch.VectorStoreFileBatch'>]
{
"id": "vs_6905db4d53708191a75c5ef9979258fd",
"created_at": 1761991501,
"file_counts": {
"cancelled": 0,
"completed": 1,
"failed": 0,
"in_progress": 0,
"total": 1
},
"object": "vector_store",
"status": "completed",
"vector_store_id": null,
"name": "test_vector_store",
"description": null,
"usage_bytes": 0,
"expires_after": null,
"expires_at": null,
"last_active_at": 1761991501,
"metadata": {}
}
# The return value contains the vector_store id.
# Shouldn't the return value of the file_batches.poll method be the batch_obj ID?
# OpenAI version:[1.109.1]
'''
OS
Ubuntu24.04
Python version
Python3.12.3
Library version
openai v1.109.1
- Ngôn ngữ chính
- Python
- Star
- 31.7k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 128
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/openai-python
-
sdk-breaking-change v4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
openai/openai-python#3837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-python#3556 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-python#2927 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug openapi
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/openai-python#2502 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
openai/openai-python#2486 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của openai/openai-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
conda-forge/conda-build-feedstock#289 · 1 bình luận · 1 reaction ·
-
`pulptest` no longer works in 4.0.0: `ImportError: Start directory is not importable: 'pulp/tests'`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
remove reddit feedsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TomCasavant/ohio-sites#224 ·