Update index.ts
This commit is contained in:
1 parent
7e946ec92e
commit
64efcf6373
1 file changed
+3
-4
+3
-4
@@ -538,15 +538,14 @@ class ConfigManager {
|
|||||||
];
|
];
|
||||||
|
|
||||||
let envProvider: string | undefined;
|
let envProvider: string | undefined;
|
||||||
|
|
||||||
for (const envPath of envPaths) {
|
for (const envPath of envPaths) {
|
||||||
if (existsSync(envPath)) {
|
if (existsSync(envPath)) {
|
||||||
const envContent = readFileSync(envPath, 'utf-8');
|
const envContent = readFileSync(envPath, 'utf-8');
|
||||||
const lines = envContent.split('\n');
|
const lines = envContent.split('\n');
|
||||||
|
|
||||||
// Validation variables added
|
// Validation variables added
|
||||||
const VALID_PROVIDERS = ['openrouter', 'venice', 'anthropic', 'openai', 'xai', 'gemini', 'local'];
|
const VALID_PROVIDERS = ['openrouter', 'venice', 'anthropic', 'openai', 'xai', 'gemini', 'local'];
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const trimmed = line.trim();
|
const trimmed = line.trim();
|
||||||
if (trimmed && !trimmed.startsWith('#')) {
|
if (trimmed && !trimmed.startsWith('#')) {
|
||||||
@@ -689,7 +688,7 @@ class ConfigManager {
|
|||||||
*/
|
*/
|
||||||
getLLMConfig(provider?: LLMProvider, model?: string): LLMConfig {
|
getLLMConfig(provider?: LLMProvider, model?: string): LLMConfig {
|
||||||
let actualProvider = provider;
|
let actualProvider = provider;
|
||||||
|
|
||||||
if (!actualProvider) {
|
if (!actualProvider) {
|
||||||
const envProvider = process.env.TEMPEST_DEFAULT_PROVIDER?.trim();
|
const envProvider = process.env.TEMPEST_DEFAULT_PROVIDER?.trim();
|
||||||
if (envProvider) {
|
if (envProvider) {
|
||||||
|
|||||||
Reference in new issue
Block a user