mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 17:06:23 +02:00
skip ask-human when running workflow as tool
This commit is contained in:
parent
54bdbe73c0
commit
88fc585cc2
2 changed files with 12 additions and 6 deletions
|
|
@ -122,12 +122,12 @@ function convertFromMessages(messages: z.infer<typeof Message>[]): ModelMessage[
|
|||
|
||||
export class AgentNode implements Step {
|
||||
private id: string;
|
||||
private background: boolean;
|
||||
private asTool: boolean;
|
||||
private agent: z.infer<typeof Agent>;
|
||||
|
||||
constructor(id: string, background: boolean) {
|
||||
constructor(id: string, asTool: boolean) {
|
||||
this.id = id;
|
||||
this.background = background;
|
||||
this.asTool = asTool;
|
||||
const agentPath = path.join(WorkDir, "agents", `${id}.json`);
|
||||
const agent = fs.readFileSync(agentPath, "utf8");
|
||||
this.agent = Agent.parse(JSON.parse(agent));
|
||||
|
|
@ -144,6 +144,9 @@ export class AgentNode implements Step {
|
|||
// tools["ask-human"] = AskHumanTool;
|
||||
// }
|
||||
for (const [name, tool] of Object.entries(this.agent.tools ?? {})) {
|
||||
if (this.asTool && name === "ask-human") {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
tools[name] = mapAgentTool(tool);
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue