Skip to content
Snippets Groups Projects
Unverified Commit 10c83485 authored by Thuc Pham's avatar Thuc Pham Committed by GitHub
Browse files

fix: allow custom task query for agents (#846)

parent 1e6a18ad
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,6 @@ import type { ...@@ -21,7 +21,6 @@ import type {
LLM, LLM,
MessageContent, MessageContent,
} from "../llm/index.js"; } from "../llm/index.js";
import { extractText } from "../llm/utils.js";
import type { BaseToolWithCall, ToolOutput } from "../types.js"; import type { BaseToolWithCall, ToolOutput } from "../types.js";
import type { import type {
AgentTaskContext, AgentTaskContext,
...@@ -169,7 +168,7 @@ export abstract class AgentWorker< ...@@ -169,7 +168,7 @@ export abstract class AgentWorker<
abstract taskHandler: TaskHandler<AI, Store, AdditionalMessageOptions>; abstract taskHandler: TaskHandler<AI, Store, AdditionalMessageOptions>;
public createTask( public createTask(
query: string, query: MessageContent,
context: AgentTaskContext<AI, Store, AdditionalMessageOptions>, context: AgentTaskContext<AI, Store, AdditionalMessageOptions>,
): ReadableStream<TaskStepOutput<AI, Store, AdditionalMessageOptions>> { ): ReadableStream<TaskStepOutput<AI, Store, AdditionalMessageOptions>> {
context.store.messages.push({ context.store.messages.push({
...@@ -305,7 +304,7 @@ export abstract class AgentRunner< ...@@ -305,7 +304,7 @@ export abstract class AgentRunner<
}); });
} }
} }
return this.#runner.createTask(extractText(message), { return this.#runner.createTask(message, {
stream, stream,
toolCallCount: 0, toolCallCount: 0,
llm: this.#llm, llm: this.#llm,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment