File tree Expand file tree Collapse file tree 2 files changed +68
-1
lines changed
template_langgraph/internals Expand file tree Collapse file tree 2 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
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 }}"
Original file line number Diff line number Diff line change @@ -71,12 +71,17 @@ def __init__(self, settings=get_notifier_settings()):
71
71
def notify (self , text : str ):
72
72
logger .info (f"Slack notify with text: { text } " )
73
73
with httpx .Client () as client :
74
- client .post (
74
+ response = client .post (
75
75
self .webhook_url ,
76
76
json = {
77
77
"text" : text ,
78
78
},
79
79
)
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 ()} " )
80
85
81
86
82
87
def get_notifier (settings : Settings = None ) -> BaseNotifier :
You can’t perform that action at this time.
0 commit comments