UNPKG

sfdx-hardis

Version:

Swiss-army-knife Toolbox for Salesforce. Allows you to define a complete CD/CD Pipeline. Orchestrate base commands and assist users with interactive wizards

22 lines 847 B
import { ChatOpenAI } from "@langchain/openai"; import { AbstractLLMProvider } from "./langChainBaseProvider.js"; export class LangChainOpenAIProvider extends AbstractLLMProvider { constructor(modelName, config) { if (!config.apiKey) { throw new Error("API key is required for OpenAI provider. Define it in a secured env var LANGCHAIN_LLM_MODEL_API_KEY"); } super(modelName, config); this.model = this.getModel(); } getModel() { const config = { modelName: this.modelName, openAIApiKey: this.config.apiKey, temperature: this.config.temperature, maxTokens: this.config.maxTokens, maxRetries: this.config.maxRetries }; return new ChatOpenAI(config); } } //# sourceMappingURL=langChainOpenAIProvider.js.map