langchainjs
langchainjs copied to clipboard
Human as a tool
I see that the python repo had a new tool that is super useful, Human as a tool (https://github.com/hwchase17/langchain/tree/master/langchain/tools/human)
I'm trying to implement it myself but am wondering if this is something anyone can help with
this is what I have so far
`import { Tool } from "./base.js";
type PromptFunc = (text: string) => void;
type InputFunc = () => Promise<string>;
class HumanInput extends Tool {
name = "Human";
description =
"You can ask a human for guidance when you think you got stuck or you are not sure what to do next. The input should be a question for the human.";
promptFunc: PromptFunc;
inputFunc: InputFunc;
constructor(promptFunc: PromptFunc, inputFunc: InputFunc) {
super();
this.promptFunc = promptFunc;
this.inputFunc = inputFunc;
}
async _call(query: string): Promise<string> {
this.promptFunc(query);
return await this.inputFunc();
}
}
export { HumanInput };`
Came here to ask this question!
figure it out?
Hi, @achammah! I'm Dosu, and I'm here to help the langchainjs team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you created this issue to seek assistance with implementing the "Human as a tool" feature from the Python repository in your personal project. You provided some details about your progress so far. There have been a couple of comments on the issue, with max-clouatre expressing a similar question and aehlke asking if you have figured it out.
Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the langchainjs repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding, and please don't hesitate to reach out if you have any further questions or concerns.