Skip to content

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

add: add a feature of config #10

wants to merge 9 commits into from

Conversation

Colk-tech
Copy link
Member

No description provided.

@Colk-tech Colk-tech self-assigned this Jul 30, 2025
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 16:08
@Colk-tech Colk-tech added the enhancement New feature or request label Jul 30, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 or SAME_TARGET_INTERVAL for clarity.
    INTERVAL_FOR_SAME_TARGET_SEC: timedelta = Field(


class DomainConfigIF(ConfigIF):
REACT_PROBABILITY: float = Field(
gte=float(0), lt=float(1),
Copy link
Preview

Copilot AI Jul 30, 2025

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.

Suggested change
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),
Copy link
Preview

Copilot AI Jul 30, 2025

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.

Suggested change
gte=timedelta(minutes=0),
gte=timedelta(),

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant