Function importAgentFromJSON

  • Imports an agent from a JSON string.

    Parses the string and delegates to importAgent.

    Parameters

    Returns Agent

    A new Agent instance.

    Throws

    If the JSON is malformed.

    Throws

    If the parsed config fails validation.

    Example

    const agent = importAgentFromJSON(fs.readFileSync('agent.json', 'utf-8'));