Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/news_summarizer_agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: news_summarizer_agent

on:
workflow_dispatch:
inputs:
text:
type: string
default: "https://example.com,https://www.youtube.com/watch?v=xxx"
required: true
description: "Comma-separated list of URLs to summarize"
scraper_type:
type: choice
options:
- mock
- httpx
- youtube_transcript
default: mock
required: true
description: "Scraper implementation"
summarizer_type:
type: choice
options:
- mock
- llm
default: mock
required: true
description: "Summarizer implementation"
notifier_type:
type: choice
options:
- mock
- slack
default: mock
required: true
description: "Notifier implementation"

env:
SCRAPER_TYPE: ${{ inputs.scraper_type }}
SUMMARIZER_TYPE: ${{ inputs.summarizer_type }}
NOTIFIER_TYPE: ${{ inputs.notifier_type }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:
news_summarizer_agent:
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up uv
shell: bash
run: pipx install uv
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Running NewsSummarizerAgent with scraper=${{ env.SCRAPER_TYPE }}, summarizer=${{ env.SUMMARIZER_TYPE }}, notifier=${{ env.NOTIFIER_TYPE }}
shell: bash
run: |
make install-deps
uv run python scripts/agent_operator.py news-summarizer-agent --urls "${{ inputs.text }}"
7 changes: 6 additions & 1 deletion template_langgraph/internals/notifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,17 @@ def __init__(self, settings=get_notifier_settings()):
def notify(self, text: str):
logger.info(f"Slack notify with text: {text}")
with httpx.Client() as client:
client.post(
response = client.post(
self.webhook_url,
json={
"text": text,
},
)
if response.status_code != 200:
logger.error(
f"Failed to send Slack notification: {response.text}, actual status code: {response.status_code}"
)
raise httpx.HTTPStatusError(f"Failed to send Slack notification: {response.json()}")


def get_notifier(settings: Settings = None) -> BaseNotifier:
Expand Down
Loading