Skip to content

Commit 5afb40c

Browse files
committed
refactor agent workflow
1 parent 1dce7be commit 5afb40c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/post_summary_to_slack.yaml renamed to .github/workflows/news_summarizer_agent.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: post_summary_to_slack
1+
name: news_summarizer_agent
22

33
on:
44
workflow_dispatch:
@@ -43,7 +43,7 @@ env:
4343
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4444

4545
jobs:
46-
post_summary_to_slack:
46+
news_summarizer_agent:
4747
runs-on: "ubuntu-latest"
4848
timeout-minutes: 5
4949
steps:
@@ -55,7 +55,7 @@ jobs:
5555
uses: actions/setup-python@v5
5656
with:
5757
python-version: 3.13
58-
- name: Running NewsSummarizerAgent with scraper ${{ env.SCRAPER_TYPE }}, summarizer ${{ env.SUMMARIZER_TYPE }}, notifier ${{ env.NOTIFIER_TYPE }}
58+
- name: Running NewsSummarizerAgent with scraper=${{ env.SCRAPER_TYPE }}, summarizer=${{ env.SUMMARIZER_TYPE }}, notifier=${{ env.NOTIFIER_TYPE }}
5959
shell: bash
6060
run: |
6161
make install-deps

template_langgraph/internals/notifiers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ def __init__(self, settings=get_notifier_settings()):
7171
def notify(self, text: str):
7272
logger.info(f"Slack notify with text: {text}")
7373
with httpx.Client() as client:
74-
client.post(
74+
response = client.post(
7575
self.webhook_url,
7676
json={
7777
"text": text,
7878
},
7979
)
80+
if response.status_code != 200:
81+
logger.error(
82+
f"Failed to send Slack notification: {response.text}, actual status code: {response.status_code}"
83+
)
84+
raise httpx.HTTPStatusError(f"Failed to send Slack notification: {response.json()}")
8085

8186

8287
def get_notifier(settings: Settings = None) -> BaseNotifier:

0 commit comments

Comments
 (0)