Skip to content

Commit

Permalink
Update agent connector
Browse files Browse the repository at this point in the history
  • Loading branch information
parzival418 committed May 20, 2024
1 parent aef543c commit b2033af
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/agent-connector/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ export async function app(fastify: FastifyInstance) {

/* AGENT MESSAGE OUTPUT STREAM */
agent.on('messageStream', async actionPayload => {
if (actionPayload.event.channel !== channelId) return // Ignore messages not for this channel
console.log(
'Comparing channelId',
actionPayload.event.channel,
channelId
)
// if (actionPayload.event.channel !== channelId) return // Ignore messages not for this channel
try {
const event = actionPayload.event
const responseId = (event.data as { responseId: string }).responseId
Expand Down Expand Up @@ -232,7 +237,12 @@ export async function app(fastify: FastifyInstance) {
})

agent.on('messageReceived', async actionPayload => {
if (actionPayload.event.channel !== channelId) return // Ignore messages not for this channel
console.log(
'Comparing channelId',
actionPayload.event.channel,
channelId
)
// if (actionPayload.event.channel !== channelId) return // Ignore messages not for this channel
console.log('agent.on messageReceived', actionPayload)
const text = actionPayload.data.content
socket.send(
Expand Down

0 comments on commit b2033af

Please sign in to comment.