77
88with workflow .unsafe .imports_passed_through ():
99 from .activities import (
10- fetch_telegram_summaries_by_date ,
11- fetch_telegram_summaries_by_date_range ,
10+ fetch_platform_summaries_by_date ,
11+ fetch_platform_summaries_by_date_range ,
1212 get_platform_name ,
1313 )
1414 from .schema import (
15- TelegramSummariesActivityInput ,
16- TelegramSummariesRangeActivityInput ,
17- TelegramGetCollectionNameInput ,
18- TelegramFetchSummariesWorkflowInput ,
15+ PlatformSummariesActivityInput ,
16+ PlatformSummariesRangeActivityInput ,
17+ PlatformGetCollectionNameInput ,
18+ PlatformFetchSummariesWorkflowInput ,
1919 )
2020
2121
2222@workflow .defn
23- class TelegramSummariesWorkflow :
23+ class PlatformSummariesWorkflow :
2424 """
25- A Temporal workflow that fetches Telegram summaries for a specified date.
25+ A Temporal workflow that fetches summaries for a specified date.
2626 """
2727
2828 @workflow .run
2929 async def run (
30- self , input : TelegramFetchSummariesWorkflowInput
30+ self , input : PlatformFetchSummariesWorkflowInput
3131 ) -> list [dict [str , Any ]]:
3232 """
33- Run the workflow to fetch Telegram summaries for the specified date.
33+ Run the workflow to fetch summaries for the specified date.
3434
3535 Parameters
3636 ----------
37- input : TelegramFetchSummariesWorkflowInput
38- Input containing platform_id, community_id, start_date, end_date, extract_text_only and collection_name
37+ input : PlatformFetchSummariesWorkflowInput
38+ Input containing platform_id, community_id, start_date, end_date, extract_text_only and platform_name
3939
4040 Returns
4141 -------
4242 list[dict[str, Any]]
4343 A list of summary objects for the specified date
4444 """
45- logging .info ("Started TelegramSummariesWorkflow !" )
45+ logging .info ("Started PlatformSummariesWorkflow !" )
4646 logging .info (
4747 (
4848 f" Platform ID: { input .platform_id } . "
@@ -56,7 +56,7 @@ async def run(
5656 # First, get the collection name
5757 platform_name = await workflow .execute_activity (
5858 get_platform_name ,
59- TelegramGetCollectionNameInput (
59+ PlatformGetCollectionNameInput (
6060 platform_id = input .platform_id , community_id = input .community_id
6161 ),
6262 schedule_to_close_timeout = timedelta (minutes = 1 ),
@@ -67,8 +67,8 @@ async def run(
6767 if input .end_date is None :
6868 logging .info ("Getting summaries by date!" )
6969 summaries = await workflow .execute_activity (
70- fetch_telegram_summaries_by_date ,
71- TelegramSummariesActivityInput (
70+ fetch_platform_summaries_by_date ,
71+ PlatformSummariesActivityInput (
7272 date = input .start_date ,
7373 platform_name = platform_name ,
7474 community_id = input .community_id ,
@@ -81,8 +81,8 @@ async def run(
8181 else :
8282 logging .info ("Getting summaries by date range!" )
8383 summaries = await workflow .execute_activity (
84- fetch_telegram_summaries_by_date_range ,
85- TelegramSummariesRangeActivityInput (
84+ fetch_platform_summaries_by_date_range ,
85+ PlatformSummariesRangeActivityInput (
8686 start_date = input .start_date ,
8787 end_date = input .end_date ,
8888 platform_name = platform_name ,
0 commit comments