Skip to content

Commit 6930282

Browse files
authored
Merge pull request #82 from ks6088ts-labs/cosmetic-changes
Cosmetic changes
2 parents ff6e25c + 5afb40c commit 6930282

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: news_summarizer_agent
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
text:
7+
type: string
8+
default: "https://example.com,https://www.youtube.com/watch?v=xxx"
9+
required: true
10+
description: "Comma-separated list of URLs to summarize"
11+
scraper_type:
12+
type: choice
13+
options:
14+
- mock
15+
- httpx
16+
- youtube_transcript
17+
default: mock
18+
required: true
19+
description: "Scraper implementation"
20+
summarizer_type:
21+
type: choice
22+
options:
23+
- mock
24+
- llm
25+
default: mock
26+
required: true
27+
description: "Summarizer implementation"
28+
notifier_type:
29+
type: choice
30+
options:
31+
- mock
32+
- slack
33+
default: mock
34+
required: true
35+
description: "Notifier implementation"
36+
37+
env:
38+
SCRAPER_TYPE: ${{ inputs.scraper_type }}
39+
SUMMARIZER_TYPE: ${{ inputs.summarizer_type }}
40+
NOTIFIER_TYPE: ${{ inputs.notifier_type }}
41+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
42+
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
43+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44+
45+
jobs:
46+
news_summarizer_agent:
47+
runs-on: "ubuntu-latest"
48+
timeout-minutes: 5
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Set up uv
52+
shell: bash
53+
run: pipx install uv
54+
- name: Set up Python 3.13
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: 3.13
58+
- name: Running NewsSummarizerAgent with scraper=${{ env.SCRAPER_TYPE }}, summarizer=${{ env.SUMMARIZER_TYPE }}, notifier=${{ env.NOTIFIER_TYPE }}
59+
shell: bash
60+
run: |
61+
make install-deps
62+
uv run python scripts/agent_operator.py news-summarizer-agent --urls "${{ inputs.text }}"

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)