-
Notifications
You must be signed in to change notification settings - Fork 0
feat: rename summarizer to be platform agnostic! #33
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
Conversation
WalkthroughThis update generalizes the summarization workflow, activities, and schema from being Telegram-specific to supporting any platform. All relevant class names, function names, type annotations, imports, and documentation references are renamed from "Telegram" to "Platform." The workflow logic, activity implementations, and schema structures remain unchanged, with updates limited to naming and contextual references. No new features or changes to control flow are introduced; the modifications are focused solely on making the summarization components platform-agnostic. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant PlatformSummariesWorkflow
participant Activities
Client->>PlatformSummariesWorkflow: Start workflow with PlatformFetchSummariesWorkflowInput
PlatformSummariesWorkflow->>Activities: get_platform_name(input)
Activities-->>PlatformSummariesWorkflow: platform name
alt Single date
PlatformSummariesWorkflow->>Activities: fetch_platform_summaries_by_date(input)
Activities-->>PlatformSummariesWorkflow: summaries
else Date range
PlatformSummariesWorkflow->>Activities: fetch_platform_summaries_by_date_range(input)
Activities-->>PlatformSummariesWorkflow: summaries by date
end
PlatformSummariesWorkflow-->>Client: Return summaries
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (2)
hivemind_summarizer/workflows.py (1)
239-241:⚠️ Potential issueVariable reference issue in log message
There's an undefined variable
collection_namein the log message. This will cause a runtime error when attempting to log the date range information.logging.info( - f"Fetching summaries for date range: {start_date} to {end_date} from collection: {collection_name}" + f"Fetching summaries for date range: {start_date} to {end_date} for platform: {platform_name}" )hivemind_summarizer/activities.py (1)
239-241:⚠️ Potential issueUndefined variable in log message
There's an undefined variable
collection_namein this log message. This will cause a runtime error as the variable isn't defined at this point in the code.logging.info( - f"Fetching summaries for date range: {start_date} to {end_date} from collection: {collection_name}" + f"Fetching summaries for date range: {start_date} to {end_date} for platform: {platform_name}" )🧰 Tools
🪛 Ruff (0.8.2)
240-240: Undefined name
collection_name(F821)
🧹 Nitpick comments (2)
workflows.py (1)
13-13: Unused import detectedThe
PlatformSummariesWorkflowis imported but not directly used in this file. Although it's registered in theWORKFLOWSlist in registry.py, it should be imported there instead of here if not used directly in this file.-from hivemind_summarizer.workflows import PlatformSummariesWorkflow🧰 Tools
🪛 Ruff (0.8.2)
13-13:
hivemind_summarizer.workflows.PlatformSummariesWorkflowimported but unusedRemove unused import:
hivemind_summarizer.workflows.PlatformSummariesWorkflow(F401)
README.md (1)
52-82: Inconsistent function naming in exampleWhile most changes consistently implement platform-agnostic naming, the function name
run_okatfirn_workflowappears to reference a specific platform rather than following the generic naming pattern. Consider usingrun_platform_workflowinstead to maintain consistency with the platform-agnostic approach.-async def run_okatfirn_workflow(): +async def run_platform_workflow():
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md(3 hunks)hivemind_summarizer/activities.py(6 hunks)hivemind_summarizer/schema.py(1 hunks)hivemind_summarizer/workflows.py(4 hunks)registry.py(2 hunks)workflows.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
workflows.py (1)
hivemind_summarizer/workflows.py (1)
PlatformSummariesWorkflow(23-95)
hivemind_summarizer/activities.py (1)
hivemind_summarizer/schema.py (3)
PlatformSummariesActivityInput(4-8)PlatformSummariesRangeActivityInput(11-16)PlatformGetCollectionNameInput(19-21)
🪛 Ruff (0.8.2)
workflows.py
13-13: hivemind_summarizer.workflows.PlatformSummariesWorkflow imported but unused
Remove unused import: hivemind_summarizer.workflows.PlatformSummariesWorkflow
(F401)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: ci / lint / Lint
- GitHub Check: ci / test / Test
🔇 Additional comments (11)
hivemind_summarizer/schema.py (1)
4-9: Good renaming for platform-agnostic modelsThe schema classes have been successfully renamed from Telegram-specific to platform-agnostic names while maintaining their structure and functionality. This change aligns with the PR objective of making the summarizer components platform-agnostic.
Also applies to: 11-16, 19-22, 24-29
README.md (1)
14-14: Good update to platform-agnostic terminologyDocumentation correctly updated to refer to "Platform Summaries" instead of "Telegram Summaries," which aligns with the PR objective.
registry.py (1)
12-16: Good workflow and activity registration updatesAll references to Telegram-specific workflow and activities have been properly updated to their platform-agnostic equivalents in the imports, workflow list, and activity registrations.
Also applies to: 22-22, 30-30, 43-45
hivemind_summarizer/workflows.py (4)
10-12: Consistent import renaming for platform-agnostic approachThe imports have been properly renamed from Telegram-specific to platform-agnostic, maintaining consistency with the PR's objective. The changes correctly import the platform-generic activity functions and schema models.
Also applies to: 15-18
23-23: Class renamed correctly to PlatformSummariesWorkflowThe workflow class has been appropriately renamed from TelegramSummariesWorkflow to PlatformSummariesWorkflow, aligning with the platform-agnostic approach.
25-25: Documentation and type annotations updated consistentlyThe docstring and type annotations have been properly updated to reflect the platform-agnostic naming convention. This ensures consistency across code and documentation.
Also applies to: 30-31, 37-38
45-45: Workflow function calls updated to use platform-agnostic namingAll workflow activity executions and log messages have been correctly updated to use the platform-agnostic naming convention, ensuring consistency throughout the codebase.
Also applies to: 59-60, 70-72, 84-86
hivemind_summarizer/activities.py (4)
16-20: Schema imports correctly updatedThe imports from the schema module have been properly renamed from Telegram-specific to platform-agnostic, ensuring consistency with the renamed schema classes.
44-45: Properly renamed activity function and parameter typesThe activity function has been correctly renamed from
get_telegram_nametoget_platform_namewith appropriate parameter type updates in the signature and docstring.Also applies to: 51-52
96-98: Activity function renamed with consistent parameter typesThe activity function has been appropriately renamed from
fetch_telegram_summaries_by_datetofetch_platform_summaries_by_datewith corresponding parameter type updates in both the signature and documentation.Also applies to: 104-105, 117-117
209-212: Date range function renamed with consistent helpersThe date range function and its supporting code have been correctly updated to the platform-agnostic naming convention. The internal call to
fetch_platform_summaries_by_dateand the creation ofPlatformSummariesActivityInputare properly aligned with the renamed functions and types.Also applies to: 218-219, 262-269
Summary by CodeRabbit
Documentation
Refactor