Skip to content

Commit

Permalink
fix: allow custom task query for agents (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
thucpn authored May 16, 2024
1 parent 1e6a18a commit 10c8348
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/agent/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -169,7 +168,7 @@ export abstract class AgentWorker<
abstract taskHandler: TaskHandler<AI, Store, AdditionalMessageOptions>;

public createTask(
query: string,
query: MessageContent,
context: AgentTaskContext<AI, Store, AdditionalMessageOptions>,
): ReadableStream<TaskStepOutput<AI, Store, AdditionalMessageOptions>> {
context.store.messages.push({
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 10c8348

Please sign in to comment.