UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

46 lines (43 loc) 1.18 kB
'use strict'; var chunk7GW2TQXP_cjs = require('./chunk-7GW2TQXP.cjs'); // src/base.ts var MastraBase = class { component = chunk7GW2TQXP_cjs.RegisteredLogger.LLM; logger; name; #rawConfig; constructor({ component, name, rawConfig }) { this.component = component || chunk7GW2TQXP_cjs.RegisteredLogger.LLM; this.name = name; this.#rawConfig = rawConfig; this.logger = new chunk7GW2TQXP_cjs.ConsoleLogger({ name: `${this.component} - ${this.name}` }); } /** * Returns the raw storage configuration this primitive was created from, * or undefined if it was created from code. */ toRawConfig() { return this.#rawConfig; } /** * Sets the raw storage configuration for this primitive. * @internal */ __setRawConfig(rawConfig) { this.#rawConfig = rawConfig; } /** * Set the logger for the agent * @param logger */ __setLogger(logger) { this.logger = "child" in logger && typeof logger.child === "function" ? logger.child({ component: this.component }) : logger; } }; exports.MastraBase = MastraBase; //# sourceMappingURL=chunk-FCQNDFEW.cjs.map //# sourceMappingURL=chunk-FCQNDFEW.cjs.map