|
1 |
| -import s from 'dedent' |
2 |
| -import { forEach, oneOf, parallel, sequence } from 'flows-ai/flows' |
| 1 | +import { forEach, parallel, sequence } from 'flows-ai/flows' |
3 | 2 | import { z } from 'zod'
|
4 | 3 |
|
5 | 4 | /**
|
@@ -78,48 +77,3 @@ export const organizationAnalysisWithSlackMessageFlow = sequence([
|
78 | 77 | input: `Send the report to the channel "${process.env['SLACK_CHANNEL_ID']}"`,
|
79 | 78 | },
|
80 | 79 | ])
|
81 |
| - |
82 |
| -/** |
83 |
| - * Flow for analyzing newsletter content and creating summaries |
84 |
| - */ |
85 |
| -export const newsletterSummaryFlow = sequence([ |
86 |
| - { |
87 |
| - agent: 'contentAgent', |
88 |
| - input: s` |
89 |
| - Extract all links from the provided newsletter URL. |
90 |
| - For each link, determine if it is an article (📜) or release (📦). |
91 |
| - Return first 5 links with URL whose type is either "article" or "release". |
92 |
| - Skip any links that point to "x.com" or "twitter.com". |
93 |
| - `, |
94 |
| - }, |
95 |
| - forEach({ |
96 |
| - item: z.object({ |
97 |
| - url: z.string().describe('The URL of the content'), |
98 |
| - type: z.enum(['article', 'release']).describe('The type of content'), |
99 |
| - }), |
100 |
| - input: oneOf([ |
101 |
| - { |
102 |
| - when: 'It is an article', |
103 |
| - input: { |
104 |
| - agent: 'contentAgent', |
105 |
| - input: 'Create a bullet-point summary of the key points from this article.', |
106 |
| - }, |
107 |
| - }, |
108 |
| - { |
109 |
| - when: 'It is a release', |
110 |
| - input: { |
111 |
| - agent: 'contentAgent', |
112 |
| - input: |
113 |
| - 'Analyze the release notes, identify any breaking changes, and highlight the most important new feature.', |
114 |
| - }, |
115 |
| - }, |
116 |
| - ]), |
117 |
| - }), |
118 |
| - { |
119 |
| - agent: 'slackAgent', |
120 |
| - input: s` |
121 |
| - Send all summaries to the channel "${process.env['SLACK_CHANNEL_ID']}". |
122 |
| - The message must start with the newsletter issue number. |
123 |
| - `, |
124 |
| - }, |
125 |
| -]) |
0 commit comments