Skip to content

Commit 894cee7

Browse files
committed
chore: visual tweaks
1 parent e197cb0 commit 894cee7

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

example/flows.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,14 @@ export const organizationAnalysisFlow = sequence([
6666
'Create an organization-wide summary analyzing patterns and insights across all projects.',
6767
},
6868
])
69+
70+
/**
71+
* Same as `organizationAnalysisFlow`, but with Slack message at the end.
72+
*/
73+
export const organizationAnalysisWithSlackMessageFlow = sequence([
74+
organizationAnalysisFlow,
75+
{
76+
agent: 'slackAgent',
77+
input: `Send the report to the channel "${process.env['SLACK_CHANNEL_ID']}"`,
78+
},
79+
])
Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { execute } from 'flows-ai'
2-
import { sequence } from 'flows-ai/flows'
32

43
import { githubAgent, slackAgent } from './agents'
5-
import { githubProjectHealthAnalysisFlow } from './flows'
4+
import { organizationAnalysisWithSlackMessageFlow } from './flows'
65

76
const projectName = process.argv[2]
87

@@ -25,24 +24,15 @@ if (!channelId) {
2524
* In this example, we run already defined `githubProjectHealthAnalysisFlow`,
2625
* and then, we send the report to Slack.
2726
*/
28-
const response = await execute(
29-
sequence([
30-
githubProjectHealthAnalysisFlow,
31-
{
32-
agent: 'slackAgent',
33-
input: `Send the report to the channel "${channelId}"`,
34-
},
35-
]),
36-
{
37-
agents: {
38-
githubAgent,
39-
slackAgent,
40-
},
41-
input: projectName,
42-
onFlowStart: (flow) => {
43-
console.log('Executing', flow.agent.name)
44-
},
45-
}
46-
)
27+
const response = await execute(organizationAnalysisWithSlackMessageFlow, {
28+
agents: {
29+
githubAgent,
30+
slackAgent,
31+
},
32+
input: projectName,
33+
onFlowStart: (flow) => {
34+
console.log('Executing', flow.agent.name)
35+
},
36+
})
4737

4838
console.log(response)

0 commit comments

Comments
 (0)