Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The return value of the vector_stores.file_batches.poll method contains the ID of the VectorStore.

オープン
#2,724 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@nightcityblade がすでに取り組んでいます。

2026年5月14日 から。

  • #2734 @yashwantbezawada による — マージされずにクローズ
  • #3238 @nightcityblade による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api, backend

調査の方向性

vector_stores.file_batches.poll メソッドから始め、この issue のサンプルコードで動作を再現します。返された VectorStoreFileBatch オブジェクトの id フィールドと object フィールドを batch_obj と比較します。poll の結果が一貫してファイルバッチを表し、期待される ID を返すことを回帰テストでカバーできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
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

主要言語
Python
スター
31.8k
フォーク
7.3k
平均マージ
1日 1時間
マージ済み PR(30日)
137

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openai/openai-python のほかの issue

openai/openai-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。