From 10c83485d29f39a158a1f9c44cc65ea9b8c69e6a Mon Sep 17 00:00:00 2001 From: Thuc Pham <51660321+thucpn@users.noreply.github.com> Date: Fri, 17 May 2024 02:48:50 +0700 Subject: [PATCH] fix: allow custom task query for agents (#846) --- packages/core/src/agent/base.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/src/agent/base.ts b/packages/core/src/agent/base.ts index cb2ce97b11..bf521e9e78 100644 --- a/packages/core/src/agent/base.ts +++ b/packages/core/src/agent/base.ts @@ -21,7 +21,6 @@ import type { LLM, MessageContent, } from "../llm/index.js"; -import { extractText } from "../llm/utils.js"; import type { BaseToolWithCall, ToolOutput } from "../types.js"; import type { AgentTaskContext, @@ -169,7 +168,7 @@ export abstract class AgentWorker< abstract taskHandler: TaskHandler; public createTask( - query: string, + query: MessageContent, context: AgentTaskContext, ): ReadableStream> { context.store.messages.push({ @@ -305,7 +304,7 @@ export abstract class AgentRunner< }); } } - return this.#runner.createTask(extractText(message), { + return this.#runner.createTask(message, { stream, toolCallCount: 0, llm: this.#llm,