local-agent
Version:
A CLI agentic system for orchestrating tools and memory with per-folder scoping
40 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Google provider implementation.
*/
class GoogleProvider {
apiKey = null;
/**
* Creates and returns a Google model instance.
* @param modelName The Google model name (e.g., "gemini-pro")
* @returns A Google model instance
*/
getModel(modelName) {
// Dynamic import to avoid loading the module until needed
const { google } = require('@ai-sdk/google');
return google(modelName);
}
/**
* Indicates if this provider requires an API key.
* For Google, an API key is required but can come from environment variables.
*/
requiresApiKey() {
return false; // Google can read from GOOGLE_GENERATIVE_AI_API_KEY env var
}
/**
* Initializes the provider with an API key.
* @param keys Object containing API keys
*/
initialize(keys) {
if (keys.google) {
this.apiKey = keys.google;
// Set environment variable if not already set
if (!process.env.GOOGLE_GENERATIVE_AI_API_KEY) {
process.env.GOOGLE_GENERATIVE_AI_API_KEY = this.apiKey;
}
}
}
}
exports.default = GoogleProvider;
//# sourceMappingURL=google-provider.js.map