Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/services/temporal/configs/temporal.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const queues = {
typescriptLight: 'TEMPORAL_QUEUE_LIGHT',
typescriptHeavy: 'TEMPORAL_QUEUE_HEAVY',
pythonLight: 'TEMPORAL_QUEUE_PYTHON_LIGHT',
pythonHeavy: 'TEMPORAL_QUEUE_PYTHON_HEAVY',
TEMPORAL_QUEUE_LIGHT: 'TEMPORAL_QUEUE_LIGHT',
TEMPORAL_QUEUE_HEAVY: 'TEMPORAL_QUEUE_HEAVY',
TEMPORAL_QUEUE_PYTHON_LIGHT: 'TEMPORAL_QUEUE_PYTHON_LIGHT',
TEMPORAL_QUEUE_PYTHON_HEAVY: 'TEMPORAL_QUEUE_PYTHON_HEAVY',
HIVEMIND_AGENT_QUEUE: 'HIVEMIND_AGENT_QUEUE',
};
2 changes: 1 addition & 1 deletion src/services/temporal/discourse.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TemporalDiscourseService extends TemporalCoreService {
type: 'startWorkflow',
workflowType: 'DiscourseExtractWorkflow',
args: [{ endpoint, platformId }],
taskQueue: queues.typescriptHeavy,
taskQueue: queues.TEMPORAL_QUEUE_HEAVY,
},
scheduleId: `discourse/${encodeURIComponent(endpoint)}`,
policies: {
Expand Down
8 changes: 3 additions & 5 deletions src/services/temporal/hivemind.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Client } from '@temporalio/client';

import parentLogger from '../../config/logger';
import { queues } from './configs/temporal.config';
import { TemporalCoreService } from './core.service';

const logger = parentLogger.child({ module: 'HivemindTemporalService' });
Expand All @@ -27,19 +28,16 @@ class HivemindTemporalService extends TemporalCoreService {
public async triggerWorkflow(communityId: string, query: string, enableAnswerSkipping: boolean) {
const client: Client = await this.getClient();

// // Construct the payload as specified
const payload: HivemindPayload = {
community_id: communityId,
query: query,
enable_answer_skipping: enableAnswerSkipping,
};
try {
const hivemindTaskQueue = 'HIVEMIND_AGENT_QUEUE';

const workflowHandle = await client.workflow.execute('AgenticHivemindTemporalWorkflow', {
taskQueue: hivemindTaskQueue,
taskQueue: queues.HIVEMIND_AGENT_QUEUE,
args: [payload],
workflowId: `hivemind-${communityId}-${Date.now()}`,
workflowId: `api:agnet-${communityId}`,
});
logger.info(`Started Hivemind workflow with ID: ${workflowHandle}`);
return workflowHandle;
Expand Down
2 changes: 1 addition & 1 deletion src/services/temporal/website.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TemporalWebsiteService extends TemporalCoreService {
type: 'startWorkflow',
workflowType: 'WebsiteIngestionSchedulerWorkflow',
args: [platformId.toString()],
taskQueue: queues.pythonHeavy,
taskQueue: queues.TEMPORAL_QUEUE_PYTHON_HEAVY,
},
policies: {
catchupWindow: '1 day',
Expand Down