Skip to content

Commit

Permalink
fix(direct client): agent type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
bentatum committed Jan 6, 2025
1 parent 0b6c745 commit 43164cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/client-direct/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class DirectClient {
});

const response = await generateMessageResponse({
runtime: runtime,
runtime: runtime as IAgentRuntime,
context,
modelClass: ModelClass.LARGE,
});
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -770,7 +770,7 @@ export class DirectClient {
});

const response = await generateMessageResponse({
runtime: runtime,
runtime: runtime as IAgentRuntime,
context,
modelClass: ModelClass.LARGE,
});
Expand Down

0 comments on commit 43164cd

Please sign in to comment.