Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseMultiActionAgent is not exported by "langchain/agents" #3477

Closed
msalafia opened this issue Dec 1, 2023 · 3 comments · Fixed by #3490
Closed

BaseMultiActionAgent is not exported by "langchain/agents" #3477

msalafia opened this issue Dec 1, 2023 · 3 comments · Fixed by #3490
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@msalafia
Copy link

msalafia commented Dec 1, 2023

As the title suggest, i was trying to import BaseMultiActionAgent but it seems like it's not exported

const { BaseMultiActionAgent } = require("langchain/agents");
image

Is any reason for that, or it's just an error?

Copy link

dosubot bot commented Dec 1, 2023

🤖

Hello @msalafia! I'm Dosu, a friendly bot created to assist you with bugs, answer your questions, and guide you on your journey to becoming a contributor. While we wait for a human maintainer, I'm here to help! Let's get started.

Based on the provided context, it appears that the BaseMultiActionAgent class is indeed defined in the "langchain/agents" module of the langchainjs codebase, but it's not included in the export statements. This means that it's not available for import in other modules.

The decision to export a class or not usually depends on whether it's intended to be used directly by users of the library or if it's just an internal detail of the library. If BaseMultiActionAgent is not exported, it might be because it's intended to be used only as a base class within the library itself, and not directly by users of the library.

If you believe that BaseMultiActionAgent should be exported, I would recommend reaching out to the maintainers of the langchainjs repository directly to discuss this. They may have chosen not to export this class for a specific reason.

Here is the relevant code snippet from the provided context:

/**
 * Abstract base class for multi-action agents in LangChain. Extends the
 * BaseAgent class and provides additional functionality specific to
 * multi-action agents.
 */
export abstract class BaseMultiActionAgent extends BaseAgent {
  _agentActionType(): string {
    return "multi" as const;
  }
/**
   * Decide what to do, given some input.
   *
   * @param steps - Steps the LLM has taken so far, along with observations from each.
   * @param inputs - User inputs.
   * @param callbackManager - Callback manager.
   *
   * @returns Actions specifying what tools to use.
   */
  abstract plan(
    steps: AgentStep[],
    inputs: ChainValues,
    callbackManager?: CallbackManager
  ): Promise<AgentAction[] | AgentFinish>;
}

You can find this code in the langchain/src/agents/agent.ts file of the langchainjs repository.

I hope this helps! If you have any other questions, feel free to ask.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Dec 1, 2023
@jacoblee93
Copy link
Collaborator

Just an oversight, please open a PR if you're able to!

@jacoblee93
Copy link
Collaborator

Nvm I got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants