Skip to content

OpenAI APIタイムアウト設定の追加とCIのPythonバージョン修正#22

Merged
mohadayo merged 1 commit intomainfrom
feat/openai-timeout-and-ci-python-version
Apr 11, 2026
Merged

OpenAI APIタイムアウト設定の追加とCIのPythonバージョン修正#22
mohadayo merged 1 commit intomainfrom
feat/openai-timeout-and-ci-python-version

Conversation

@mohadayo
Copy link
Copy Markdown
Owner

概要

  • OpenAI APIクライアントに httpx.Timeout を使用したタイムアウト設定を追加し、APIの応答遅延によるリクエストの無期限ブロックを防止
  • CIのPythonバージョンを3.11から3.12に更新
  • タイムアウト設定が正しく適用されることを確認するユニットテストを追加

変更内容

OpenAI APIタイムアウト設定

  • backend/services/rag_service.py: _get_client()httpx.Timeout(30.0, connect=10.0) を設定
  • backend/services/embedding_service.py: _get_client() に同様のタイムアウト設定を追加
  • backend/config.py: openai_timeout(デフォルト30秒)と openai_connect_timeout(デフォルト10秒)の設定値を追加

CIのPythonバージョン修正

  • .github/workflows/ci.yml: Python 3.11 → 3.12 に更新

テスト追加

  • backend/tests/test_timeout_settings.py: 5件のテストを追加
    • rag_service / embedding_service のクライアントにタイムアウトが設定されることを確認
    • config の設定値がクライアントに反映されることを確認
    • config のデフォルト値が正しいことを確認

テスト結果

  • flake8: エラー0件
  • pytest: 48件全テストパス(新規5件含む)

Closes #21

- backend/services/rag_service.py と embedding_service.py の OpenAI クライアント初期化時に httpx.Timeout を使用したタイムアウトを設定
- backend/config.py に openai_timeout と openai_connect_timeout の設定値を追加
- .github/workflows/ci.yml の Python バージョンを 3.11 から 3.12 に更新
- タイムアウト設定のユニットテストを追加

Closes #21
@mohadayo mohadayo merged commit 67912a1 into main Apr 11, 2026
1 check passed
@mohadayo mohadayo deleted the feat/openai-timeout-and-ci-python-version branch April 11, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI APIタイムアウト設定の追加とCIのPythonバージョン修正

1 participant