This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
🛠️ 環境変数バリデーションの強化とログ出力の改善 #305
Open
Sunwood-ai-labs
wants to merge
6
commits into
takahiroanno2024:main
Choose a base branch
from
Sunwood-ai-labs:feature/188-enhance-env-var-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🛠️ 環境変数バリデーションの強化とログ出力の改善 #305
Sunwood-ai-labs
wants to merge
6
commits into
takahiroanno2024:main
from
Sunwood-ai-labs:feature/188-enhance-env-var-validation
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- python-dotenv, loguru, pydantic-settingsを追加し、環境設定とログ管理を強化
- dotenvの使用を廃止し、pydantic_settingsで環境設定のモデルを組み立て - loguruを導入して詳細なログ出力を実現 - GithubHandler, ContentModerator, QdrantHandlerのクラスを再設計し、設定情報の取り扱いを改善 - コンテンツモデレーターでの画像の検証プロセスを改善し、OpenAI APIを利用する部分でエラーハンドリングを追加
- pydantic-settingsのバージョンを更新し、python-dotenvを追加することで環境設定の管理を改善
…読み込むクラスの整理 - `.env` ファイルから設定を読み込む `Settings` クラス内の `openai_api_key` 属性に関するコメントをクリーンアップ。 - ファイル末尾に新しい行を追加してフォーマットを改善。
banbiossa
reviewed
Jul 5, 2024
.github/requirements.txt
Outdated
python-dotenv==1.0.1 | ||
loguru==0.7.2 | ||
pydantic-settings==2.2.1 | ||
python-dotenv==1.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotenv が2回書かれているので消していただけますと!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます。修正しました!
- python-dotenv の重複エントリーを削除し、依存関係リストをクリーンアップ
ogadra
approved these changes
Jul 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ぱっとみ良さそうに思いました!!!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
本プルリクエストでは、
review_issue.py
スクリプトに対して以下の2つの主要な改善を行いました:これらの変更により、アプリケーションの安定性とデバッグ効率が向上します。
変更内容
1. 環境変数のバリデーション強化
pydantic_settings
を導入し、Settings
クラスを実装extra = 'ignore'
オプションを追加2. ログ出力の改善
loguru
ライブラリを導入し、詳細なログ出力を実装▽下記のように可視化されます
期待される効果
注意点
pydantic-settings
、loguru
)をインストールする必要がありますSettings
クラスの定義を更新する必要があります関連Issue
ご確認とレビューをお願いいたします。