Skip to content

Commit

Permalink
chore: visual tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
grabbou committed Jan 26, 2025
1 parent e197cb0 commit 894cee7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
11 changes: 11 additions & 0 deletions example/flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,14 @@ export const organizationAnalysisFlow = sequence([
'Create an organization-wide summary analyzing patterns and insights across all projects.',
},
])

/**
* Same as `organizationAnalysisFlow`, but with Slack message at the end.
*/
export const organizationAnalysisWithSlackMessageFlow = sequence([
organizationAnalysisFlow,
{
agent: 'slackAgent',
input: `Send the report to the channel "${process.env['SLACK_CHANNEL_ID']}"`,
},
])
32 changes: 11 additions & 21 deletions example/run-organization-analysis-with-slack-message.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { execute } from 'flows-ai'
import { sequence } from 'flows-ai/flows'

import { githubAgent, slackAgent } from './agents'
import { githubProjectHealthAnalysisFlow } from './flows'
import { organizationAnalysisWithSlackMessageFlow } from './flows'

const projectName = process.argv[2]

Expand All @@ -25,24 +24,15 @@ if (!channelId) {
* In this example, we run already defined `githubProjectHealthAnalysisFlow`,
* and then, we send the report to Slack.
*/
const response = await execute(
sequence([
githubProjectHealthAnalysisFlow,
{
agent: 'slackAgent',
input: `Send the report to the channel "${channelId}"`,
},
]),
{
agents: {
githubAgent,
slackAgent,
},
input: projectName,
onFlowStart: (flow) => {
console.log('Executing', flow.agent.name)
},
}
)
const response = await execute(organizationAnalysisWithSlackMessageFlow, {
agents: {
githubAgent,
slackAgent,
},
input: projectName,
onFlowStart: (flow) => {
console.log('Executing', flow.agent.name)
},
})

console.log(response)

0 comments on commit 894cee7

Please sign in to comment.