Skip to content

Commit ed98fc4

Browse files
committed
mock inference executor
1 parent a1b4cbb commit ed98fc4

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

agents/src/cli.ts

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -243,35 +243,14 @@ export const runApp = (opts: WorkerOptions) => {
243243
}
244244

245245
const { CurrentJobContext } = await import('./job.js');
246-
const { InferenceRunner } = await import('./inference_runner.js');
247-
248-
let inferenceExecutor: any = undefined;
249-
if (Object.entries(InferenceRunner.registeredRunners).length) {
250-
const runners: { [id: string]: any } = {};
251-
for (const [method, importPath] of Object.entries(InferenceRunner.registeredRunners)) {
252-
logger.debug(`Loading inference runner for ${method}`);
253-
const mod = await import(importPath);
254-
runners[method] = new mod.default();
255-
await runners[method].initialize();
256-
}
257-
258-
inferenceExecutor = {
259-
doInference: async (method: string, data: unknown) => {
260-
const runner = runners[method];
261-
if (!runner) {
262-
logger.warn(`No runner found for method ${method}`);
263-
return {};
264-
}
265-
return runner.run(data);
266-
}
267-
};
268-
}
269246

270247
const mockCtx = {
271248
room: undefined,
272249
proc: { userData: {} },
273250
connect: async () => {},
274-
inferenceExecutor: inferenceExecutor || { doInference: async () => ({}) }
251+
inferenceExecutor: {
252+
doInference: async () => ({}) // Mock inference executor for now to keep things simple
253+
}
275254
};
276255

277256
new CurrentJobContext(mockCtx as any);

0 commit comments

Comments
 (0)