-
-
Notifications
You must be signed in to change notification settings - Fork 0
add: add a feature of config #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR introduces a configuration system framework with domain-specific settings for message reaction behavior. The implementation establishes a hierarchical interface structure using Pydantic for configuration validation.
- Creates a base configuration interface using Pydantic BaseModel and ABC
- Implements domain-specific configuration with reaction probability and timing controls
- Establishes validation constraints for configuration parameters
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/common/interface.py | Defines base Interface as an alias for ABC |
src/config/interface.py | Creates ConfigIF base class combining BaseModel and Interface |
src/domain/interface/config/domain.py | Implements DomainConfigIF with reaction behavior configuration fields |
Comments suppressed due to low confidence (1)
src/domain/interface/config/domain.py:13
- [nitpick] The field name ends with 'SEC' but the type is timedelta, which can represent any time unit. Consider renaming to
INTERVAL_FOR_SAME_TARGET
orSAME_TARGET_INTERVAL
for clarity.
INTERVAL_FOR_SAME_TARGET_SEC: timedelta = Field(
|
||
class DomainConfigIF(ConfigIF): | ||
REACT_PROBABILITY: float = Field( | ||
gte=float(0), lt=float(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.
[nitpick] Using float(0)
and float(1)
is unnecessary since 0
and 1
are automatically converted to floats. Consider using gte=0.0, lt=1.0
for clarity.
gte=float(0), lt=float(1), | |
gte=0.0, lt=1.0, |
Copilot uses AI. Check for mistakes.
description="Probability to react to a message" | ||
) | ||
INTERVAL_FOR_SAME_TARGET_SEC: timedelta = Field( | ||
gte=timedelta(minutes=0), |
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.
[nitpick] Using timedelta(minutes=0)
is unnecessarily verbose. Consider using gte=timedelta(0)
or gte=timedelta()
for simplicity.
gte=timedelta(minutes=0), | |
gte=timedelta(), |
Copilot uses AI. Check for mistakes.
No description provided.