From 43164cd4cf75cdebd29bb80c969b4f4557a1229d Mon Sep 17 00:00:00 2001 From: Ben Tatum Date: Mon, 6 Jan 2025 09:56:31 -0500 Subject: [PATCH] fix(direct client): agent type casting --- packages/client-direct/src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 03d4f92bab..ee098f5707 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -285,7 +285,7 @@ export class DirectClient { }); const response = await generateMessageResponse({ - runtime: runtime, + runtime: runtime as IAgentRuntime, context, modelClass: ModelClass.LARGE, }); @@ -473,7 +473,7 @@ export class DirectClient { // Call LLM const response = await generateObject({ - runtime, + runtime: runtime as IAgentRuntime, context, modelClass: ModelClass.SMALL, // 1s processing time on openai small schema: hyperfiOutSchema, @@ -574,13 +574,13 @@ export class DirectClient { res.status(404).send("Agent not found"); return; } - const images = await generateImage({ ...req.body }, agent); + const images = await generateImage({ ...req.body }, agent as IAgentRuntime); const imagesRes: { image: string; caption: string }[] = []; if (images.data && images.data.length > 0) { for (let i = 0; i < images.data.length; i++) { const caption = await generateCaption( { imageUrl: images.data[i] }, - agent + agent as IAgentRuntime ); imagesRes.push({ image: images.data[i], @@ -770,7 +770,7 @@ export class DirectClient { }); const response = await generateMessageResponse({ - runtime: runtime, + runtime: runtime as IAgentRuntime, context, modelClass: ModelClass.LARGE, });